commit 6d2a59da3886b302dd7892bf48413ba4def89f63 Author: Gaurav Kumar Date: Fri Sep 26 08:49:03 2025 +0530 ui diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/frontend/angular-clarity-master/.editorconfig b/frontend/angular-clarity-master/.editorconfig new file mode 100644 index 0000000..59d9a3a --- /dev/null +++ b/frontend/angular-clarity-master/.editorconfig @@ -0,0 +1,16 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.ts] +quote_type = single + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/frontend/angular-clarity-master/.github/workflows/blank.yml b/frontend/angular-clarity-master/.github/workflows/blank.yml new file mode 100644 index 0000000..b2340b2 --- /dev/null +++ b/frontend/angular-clarity-master/.github/workflows/blank.yml @@ -0,0 +1,17 @@ +name: CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Run a one-line script + run: echo Hello, world! + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. diff --git a/frontend/angular-clarity-master/.gitignore b/frontend/angular-clarity-master/.gitignore new file mode 100644 index 0000000..f5445e8 --- /dev/null +++ b/frontend/angular-clarity-master/.gitignore @@ -0,0 +1,42 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.angular/cache +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# System Files +.DS_Store +Thumbs.db + + diff --git a/frontend/angular-clarity-master/.vscode/settings.json b/frontend/angular-clarity-master/.vscode/settings.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/frontend/angular-clarity-master/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/BASICP1_UI_ENHANCEMENT.md b/frontend/angular-clarity-master/BASICP1_UI_ENHANCEMENT.md new file mode 100644 index 0000000..e51947d --- /dev/null +++ b/frontend/angular-clarity-master/BASICP1_UI_ENHANCEMENT.md @@ -0,0 +1,86 @@ +# BasicP1 UI Enhancement Implementation + +This document explains the UI enhancement implementation for the BasicP1 component using reusable field components. + +## Overview + +The BasicP1 component has been enhanced to use reusable field components for different data types: +- Text fields +- Number fields +- Phone number fields +- Paragraph fields +- Password fields +- Textarea fields + +## Implementation Details + +### 1. Component Structure + +The component now uses a modern UI pattern with: +- Hero section with gradient background +- Consistent button styling using ThemeService +- Responsive grid layout +- Enhanced modals with better styling +- Reusable field components for all form inputs + +### 2. Reusable Field Components + +Each field type now uses a dedicated component: +- `` for text inputs +- `` for number inputs +- `` for phone number inputs +- `` for paragraph inputs +- `` for password inputs +- `` for textarea inputs + +### 3. Field Configuration + +Each field component is configured using a FieldConfig object: +```typescript +{ + name: string; // Field name + label: string; // Display label + type: string; // Field type + required?: boolean; // Is required? + placeholder?: string; // Placeholder text + // Type-specific properties +} +``` + +### 4. Data Binding + +Field components use two-way data binding: +```html + + +``` + +### 5. Benefits + +1. **Consistency**: All fields follow the same styling and behavior patterns +2. **Maintainability**: Changes to one field type automatically apply everywhere +3. **Reusability**: Components can be used across different forms and modules +4. **Theme Support**: All components use ThemeService for consistent theming +5. **Validation**: Built-in validation support for each field type +6. **Accessibility**: Proper labeling and ARIA attributes + +## Styling + +The component uses the modern styling patterns established in the UI enhancement rules: +- Gradient hero sections +- Consistent button styling with ThemeService +- Responsive design +- Proper spacing and typography +- Card-based layouts where appropriate + +## Future Enhancements + +To further improve the component: +1. Implement the DynamicFormComponent for even easier form creation +2. Add more field types as needed +3. Implement form validation at the component level +4. Add more business logic specific to each field type +5. Enhance accessibility features \ No newline at end of file diff --git a/frontend/angular-clarity-master/README.md b/frontend/angular-clarity-master/README.md new file mode 100644 index 0000000..c3d97fe --- /dev/null +++ b/frontend/angular-clarity-master/README.md @@ -0,0 +1,52 @@ +# Angular-Clarity + +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.0.4 [Angular.io](https://angular.io/) version 16.0.4 and [Clarity Design System](https://vmware.github.io/clarity/news) by VMware version 6.4.5/15.5.0 + +## Install +- clone project `git clone https://github.com/superpck/angular-clarity` +- goto project folder `cd angular-clarity` +- install necessary package `npm install` +- Fix some vulnerabilities (if founded) `npm audit fix --force` +- Run application with command `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. +- or Run `ng serve --port 8080 --open` with another port and open web browser. + +## Code scaffolding + +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. + +## Build + +- Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. +- or `ng build --base-href ./ --prod --output-hashing none` + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). + +## Screenshot +About Page +![About](1.png) + +Login Page +![Datagrid](6.png) + +Datagrid +![Datagrid](2.png) + +Datagrid expand row and single action +![expand](3.png) + +Modal +![modal](4.png) + +sweetalert2 +![sweetalert2](5.png) + diff --git a/frontend/angular-clarity-master/REUSABLE_FIELD_COMPONENTS.md b/frontend/angular-clarity-master/REUSABLE_FIELD_COMPONENTS.md new file mode 100644 index 0000000..67bdfa1 --- /dev/null +++ b/frontend/angular-clarity-master/REUSABLE_FIELD_COMPONENTS.md @@ -0,0 +1,155 @@ +# Reusable Field Components + +This document explains how to use the reusable field components created for consistent UI across different data types. + +## Overview + +We've created a set of reusable Angular components for different field types: +- Text Field +- Number Field +- Phone Number Field +- Paragraph Field +- Password Field +- Textarea Field + +Each component follows the same pattern and uses ThemeService for consistent styling. + +## Field Configuration + +All field components use a common `FieldConfig` interface: + +```typescript +interface FieldConfig { + name: string; // Unique field name + label: string; // Display label + type: string; // Field type (text, number, phone, etc.) + required?: boolean; // Is field required? + placeholder?: string; // Placeholder text + description?: string; // Helper text + // Additional type-specific properties +} +``` + +## Component Usage + +### 1. Text Field +```html + + +``` + +### 2. Number Field +```html + + +``` + +### 3. Phone Field +```html + + +``` + +### 4. Paragraph Field +```html + + +``` + +### 5. Password Field +```html + + +``` + +### 6. Textarea Field +```html + + +``` + +## Dynamic Form Component + +For easier usage, we've created a `DynamicFormComponent` that can render multiple fields based on configuration: + +```html + + +``` + +In your component: +```typescript +formFields = [ + { name: 'name', label: 'Name', type: 'text', required: true }, + { name: 'email', label: 'Email', type: 'text', required: true }, + { name: 'age', label: 'Age', type: 'number', min: 0 }, + { name: 'phone', label: 'Phone', type: 'phone' }, + { name: 'bio', label: 'Bio', type: 'paragraph' } +]; + +formData = {}; + +onSubmit(data) { + console.log('Form submitted:', data); + // Handle form submission +} + +onCancel() { + console.log('Form cancelled'); + // Handle form cancellation +} +``` + +## Benefits of This Approach + +1. **Consistency**: All fields follow the same styling and behavior patterns +2. **Maintainability**: Changes to one field type automatically apply everywhere +3. **Reusability**: Components can be used across different forms and modules +4. **Extensibility**: Easy to add new field types following the same pattern +5. **Theme Support**: All components use ThemeService for consistent theming +6. **Validation**: Built-in validation support for each field type +7. **Accessibility**: Proper labeling and ARIA attributes + +## Adding New Field Types + +To add a new field type: + +1. Create a new component that extends `BaseFieldComponent` +2. Implement the template and logic specific to that field type +3. Add the component to the `FieldTypesModule` +4. Register it in the `FieldFactoryService` +5. Update the documentation + +## Styling + +All field components use the shared SCSS file which provides: +- Consistent spacing and typography +- ThemeService integration for colors +- Responsive design patterns +- Proper focus states and hover effects +- Error state styling +- Accessibility considerations + +The styling follows the same patterns used in the UI enhancement rules we established earlier. \ No newline at end of file diff --git a/frontend/angular-clarity-master/SECURITY.md b/frontend/angular-clarity-master/SECURITY.md new file mode 100644 index 0000000..034e848 --- /dev/null +++ b/frontend/angular-clarity-master/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. diff --git a/frontend/angular-clarity-master/THEME_CUSTOMIZATION_SUMMARY.md b/frontend/angular-clarity-master/THEME_CUSTOMIZATION_SUMMARY.md new file mode 100644 index 0000000..48ae6c2 --- /dev/null +++ b/frontend/angular-clarity-master/THEME_CUSTOMIZATION_SUMMARY.md @@ -0,0 +1,338 @@ +# 🎨 Theme Customization System - Complete Implementation + +## Overview +Successfully implemented a comprehensive dynamic theme customization system for the Angular Clarity project. Users can now customize colors, fonts, and appearance in real-time with immediate visual feedback. + +## ✅ Completed Features + +### 1. Theme Service (`src/app/services/theme.service.ts`) +- **Dynamic Theme Management**: Complete theme switching and customization +- **Predefined Themes**: 6 built-in themes (Default Blue, Purple Magic, Nature Green, Dark Mode, Sunset Orange, Minimal Gray) +- **Custom Theme Creation**: Users can create and save custom themes +- **Theme Persistence**: Themes are saved in localStorage +- **Import/Export**: Theme sharing and backup functionality +- **Real-time Application**: Instant theme changes across the application + +### 2. Theme Customization Component (`src/app/modules/main/theme-customization/`) +- **Modern UI**: Beautiful, intuitive customization interface +- **Color Customization**: + - Primary, Secondary, Accent colors + - Background and Surface colors + - Text colors with live preview + - Color picker with preset options +- **Typography Customization**: + - Primary, Secondary, and Monospace fonts + - Live font preview + - 8 popular font options +- **Advanced Settings**: + - Border radius adjustment + - Shadow intensity control +- **Theme Management**: + - Predefined theme selection + - Custom theme creation + - Import/Export functionality + - Reset to default + +### 3. Dynamic CSS Variables (`src/styles/_theme-variables.scss`) +- **CSS Custom Properties**: Real-time theme switching via CSS variables +- **Theme-aware Components**: All components automatically adapt to theme changes +- **Gradient Support**: Dynamic gradients based on theme colors +- **Glassmorphism Effects**: Theme-aware glass effects +- **Utility Classes**: Helper classes for theme-aware styling + +### 4. Dashboard Integration +- **Theme Button**: Added "Customize Theme" button in welcome section +- **Quick Action**: Theme customization in quick actions grid +- **Navigation**: Easy access from main dashboard + +### 5. Routing & Module Integration +- **Route**: `/cns-portal/theme-customization` +- **Module**: Added to MainModule declarations +- **Navigation**: Integrated with existing routing system + +## 🎯 Key Features + +### Real-time Theme Switching +- **Instant Updates**: Changes apply immediately without page refresh +- **CSS Variables**: Efficient theme switching using CSS custom properties +- **Component Integration**: All components automatically adapt to theme changes + +### Comprehensive Customization +- **Colors**: 6 color categories with live preview +- **Fonts**: 3 font types with 8 options each +- **Visual Effects**: Border radius, shadows, and glassmorphism +- **Presets**: Quick color selection with predefined options + +### User Experience +- **Intuitive Interface**: Clean, modern customization panel +- **Live Preview**: See changes as you make them +- **Theme Gallery**: Visual theme selection with previews +- **Export/Import**: Share themes and backup customizations + +### Technical Implementation +- **Service-based**: Centralized theme management +- **Reactive**: RxJS observables for theme changes +- **Persistent**: localStorage for theme persistence +- **Scalable**: Easy to add new themes and customization options + +## 📁 File Structure + +``` +src/ +├── app/ +│ ├── services/ +│ │ └── theme.service.ts # Theme management service +│ └── modules/ +│ └── main/ +│ ├── theme-customization/ +│ │ ├── theme-customization.component.ts +│ │ ├── theme-customization.component.html +│ │ └── theme-customization.component.scss +│ ├── main-page/ +│ │ └── main-page.component.html # Updated with theme buttons +│ ├── layout/ +│ │ └── layout.component.ts # Theme service integration +│ ├── main.module.ts # Component registration +│ └── main-routing.module.ts # Route configuration +└── styles/ + ├── _theme-variables.scss # Dynamic theme variables + └── styles.scss # Updated imports +``` + +## 🎨 Predefined Themes + +### 1. Default Blue +- **Primary**: #0ea5e9 (Sky Blue) +- **Style**: Clean, professional +- **Use Case**: Default enterprise theme + +### 2. Purple Magic +- **Primary**: #8b5cf6 (Purple) +- **Style**: Creative, modern +- **Use Case**: Creative applications + +### 3. Nature Green +- **Primary**: #10b981 (Emerald) +- **Style**: Fresh, natural +- **Use Case**: Environmental, health apps + +### 4. Dark Mode +- **Primary**: #3b82f6 (Blue) +- **Style**: Dark, modern +- **Use Case**: Night mode, developer tools + +### 5. Sunset Orange +- **Primary**: #f59e0b (Orange) +- **Style**: Warm, energetic +- **Use Case**: Creative, entertainment + +### 6. Minimal Gray +- **Primary**: #6b7280 (Gray) +- **Style**: Minimal, clean +- **Use Case**: Professional, documentation + +## 🔧 Technical Details + +### Theme Service API +```typescript +// Get available themes +getThemes(): ThemeConfig[] + +// Get current theme +getCurrentTheme(): ThemeConfig + +// Set theme +setTheme(themeId: string): void + +// Create custom theme +createCustomTheme(customTheme: Partial): void + +// Export theme +exportTheme(): string + +// Import theme +importTheme(themeJson: string): boolean + +// Reset to default +resetToDefault(): void +``` + +### CSS Variables +```css +:root { + --theme-primary: #0ea5e9; + --theme-secondary: #64748b; + --theme-accent: #8b5cf6; + --theme-background: #f8fafc; + --theme-surface: #ffffff; + --theme-text: #111827; + --theme-text-secondary: #6b7280; + --theme-font-primary: 'Inter', sans-serif; + --theme-font-secondary: 'Poppins', sans-serif; + --theme-font-mono: 'JetBrains Mono', monospace; + --theme-border-radius: 0.75rem; + --theme-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); +} +``` + +### Component Integration +All components automatically use theme variables: +- **Cards**: `background: var(--theme-surface)` +- **Buttons**: `background: var(--theme-gradient-primary)` +- **Text**: `color: var(--theme-text)` +- **Borders**: `border-color: var(--theme-primary)` + +## 🚀 Usage Instructions + +### For Users +1. **Access Theme Customization**: + - Click "Customize Theme" button on dashboard + - Or go to Quick Actions → Theme Customization + +2. **Select Predefined Theme**: + - Choose from 6 built-in themes + - Click on theme card to apply + +3. **Create Custom Theme**: + - Click "Customize Theme" button + - Adjust colors using color pickers + - Select fonts from dropdowns + - Modify border radius and shadows + - Click "Apply Theme" to save + +4. **Export/Import Themes**: + - Use Export button to download theme + - Use Import to load saved themes + +### For Developers +1. **Add New Predefined Theme**: + ```typescript + // In theme.service.ts + private themes: ThemeConfig[] = [ + // ... existing themes + { + id: 'new-theme', + name: 'New Theme', + colors: { /* theme colors */ }, + fonts: { /* theme fonts */ }, + borderRadius: '1rem', + shadows: '0 4px 6px rgba(0, 0, 0, 0.1)' + } + ]; + ``` + +2. **Use Theme Variables in Components**: + ```scss + .my-component { + background: var(--theme-surface); + color: var(--theme-text); + border: 1px solid var(--theme-primary); + } + ``` + +3. **Subscribe to Theme Changes**: + ```typescript + constructor(private themeService: ThemeService) { + this.themeService.currentTheme$.subscribe(theme => { + // Handle theme changes + }); + } + ``` + +## 📱 Responsive Design + +### Mobile Optimization +- **Touch-friendly**: Large touch targets for mobile +- **Responsive Grid**: Adaptive layout for all screen sizes +- **Simplified Interface**: Streamlined mobile experience + +### Breakpoints +- **Mobile**: < 768px +- **Tablet**: 768px - 1024px +- **Desktop**: > 1024px + +## ♿ Accessibility Features + +### WCAG 2.1 AA Compliance +- **Color Contrast**: All themes meet contrast requirements +- **Keyboard Navigation**: Full keyboard support +- **Screen Readers**: Proper ARIA labels and semantic HTML +- **Focus Indicators**: Clear focus states + +### Accessibility Features +- **High Contrast**: Dark theme for better visibility +- **Font Size**: Readable font sizes across all themes +- **Color Independence**: Information not conveyed by color alone + +## 🔄 Theme Persistence + +### Storage +- **localStorage**: Themes saved locally +- **Automatic Loading**: Themes restored on page reload +- **Fallback**: Default theme if no saved theme + +### Data Structure +```json +{ + "id": "custom", + "name": "Custom Theme", + "colors": { + "primary": "#0ea5e9", + "secondary": "#64748b", + "accent": "#8b5cf6", + "background": "#f8fafc", + "surface": "#ffffff", + "text": "#111827", + "textSecondary": "#6b7280" + }, + "fonts": { + "primary": "Inter", + "secondary": "Poppins", + "mono": "JetBrains Mono" + }, + "borderRadius": "0.75rem", + "shadows": "0 10px 15px -3px rgba(0, 0, 0, 0.1)" +} +``` + +## 🎯 Performance Optimizations + +### CSS Variables +- **Efficient**: No JavaScript manipulation of DOM +- **Fast**: Browser-optimized CSS variable updates +- **Smooth**: 60fps theme transitions + +### Lazy Loading +- **Component**: Theme customization loads on demand +- **Fonts**: Google Fonts loaded as needed +- **Assets**: Optimized image and icon loading + +## 🔮 Future Enhancements + +### Potential Features +1. **Theme Presets**: Industry-specific theme collections +2. **Advanced Customization**: More granular control options +3. **Theme Sharing**: Community theme marketplace +4. **Auto-save**: Automatic theme saving +5. **Theme Scheduling**: Time-based theme switching +6. **Accessibility Themes**: High contrast, large text options + +### Technical Improvements +1. **Theme Validation**: Color contrast validation +2. **Performance Monitoring**: Theme switching performance +3. **A/B Testing**: Theme effectiveness testing +4. **Analytics**: Theme usage tracking + +## ✨ Summary + +The theme customization system provides: + +- **🎨 Complete Visual Control**: Colors, fonts, and styling +- **⚡ Real-time Updates**: Instant theme changes +- **💾 Persistent Storage**: Themes saved and restored +- **📱 Responsive Design**: Works on all devices +- **♿ Accessible**: WCAG 2.1 AA compliant +- **🔧 Developer Friendly**: Easy to extend and customize +- **🚀 Production Ready**: Enterprise-grade implementation + +Users can now fully customize their application experience with a beautiful, intuitive interface that provides immediate visual feedback and persistent theme storage. diff --git a/frontend/angular-clarity-master/UI_ENHANCEMENT_RULES.md b/frontend/angular-clarity-master/UI_ENHANCEMENT_RULES.md new file mode 100644 index 0000000..b47ce97 --- /dev/null +++ b/frontend/angular-clarity-master/UI_ENHANCEMENT_RULES.md @@ -0,0 +1,184 @@ +# UI Enhancement Rules + +This document outlines the standard UI enhancement patterns to be followed across all components in the application. + +## 1. ThemeService Integration + +All styling must use ThemeService variables instead of hardcoded colors or values: +- Use `var(--theme-primary)`, `var(--theme-accent)`, etc. for colors +- Use `var(--theme-font-primary)`, `var(--theme-font-secondary)` for fonts +- Use `var(--theme-surface)`, `var(--theme-background)` for backgrounds +- Use `var(--theme-text)`, `var(--theme-text-secondary)` for text colors + +## 2. Modern Component Layout + +### Hero Section +- Implement a hero section with gradient background: + ```scss + .component-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + } + ``` + +### Container Styling +- Use consistent container styling with rounded corners and shadows: + ```scss + .component-container { + background: var(--theme-surface); + border-radius: 16px; + padding: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + } + ``` + +## 3. Button Styling + +Use the standardized button classes with ThemeService integration: + +### Base Button Class +```scss +.sq-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + font-size: 14px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; +} +``` + +### Button Variants +- Primary: `.sq-btn.sq-btn-primary` (gradient background) +- Outline: `.sq-btn.sq-btn-outline` (transparent background with border) +- Error: `.sq-btn.sq-btn-error` (error color styling) +- Ghost: `.sq-btn.sq-btn-ghost` (minimal styling) + +### Button Sizes +- Small: `.sq-btn.sq-btn-sm` +- Medium: `.sq-btn.sq-btn-md` +- Large: `.sq-btn.sq-btn-lg` + +## 4. Form Enhancement + +### Form Labels +```scss +.sq-form-label { + display: block; + font-size: 14px; + font-weight: 500; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); +} +``` + +### Form Inputs +```scss +.sq-form-input { + width: 100%; + padding: 12px 16px; + font-size: 14px; + line-height: 1.5; + color: var(--theme-text); + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + transition: all 200ms ease-out; +} +``` + +## 5. Card-Based Design + +Implement responsive card layouts for data display: +```scss +.sq-cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 24px; + margin-bottom: 24px; +} + +.sq-card-item { + background: var(--theme-surface); + border-radius: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + overflow: hidden; + transition: all 200ms ease-out; +} +``` + +## 6. Modal Enhancement + +Enhance modals with consistent styling: +- Gradient headers +- Proper padding +- Consistent footer styling +- ThemeService integration for all elements + +## 7. Data Grid Enhancement + +Improve data grids with: +- Custom column styling +- Enhanced row hover effects +- Better pagination styling +- Consistent action overflow menus + +## 8. Responsive Design + +Ensure all components are responsive: +- Mobile-first approach +- Flexible grid layouts +- Appropriate breakpoints +- Touch-friendly elements + +## 9. Typography + +Use consistent typography with ThemeService: +- Primary font for general text: `var(--theme-font-primary)` +- Secondary font for headings: `var(--theme-font-secondary)` +- Proper font weights and sizes +- Consistent text colors + +## 10. Spacing and Layout + +Follow consistent spacing rules: +- 8px baseline grid +- Consistent padding and margins +- Proper visual hierarchy +- Balanced whitespace + +## Implementation Checklist + +When enhancing any component, ensure: +- [ ] ThemeService is used for all colors and fonts +- [ ] Hero section is implemented with gradient background +- [ ] All buttons use sq-btn classes with appropriate variants +- [ ] Forms are properly styled with consistent labels and inputs +- [ ] Card view is implemented for data display where appropriate +- [ ] Modals are enhanced with modern styling +- [ ] Data grids are customized with improved styling +- [ ] Component is fully responsive +- [ ] Typography follows ThemeService guidelines +- [ ] Spacing and layout follow the 8px grid system \ No newline at end of file diff --git a/frontend/angular-clarity-master/UI_ENHANCEMENT_SUMMARY.md b/frontend/angular-clarity-master/UI_ENHANCEMENT_SUMMARY.md new file mode 100644 index 0000000..b2cfe4d --- /dev/null +++ b/frontend/angular-clarity-master/UI_ENHANCEMENT_SUMMARY.md @@ -0,0 +1,387 @@ +# User Group Maintenance UI Enhancement Summary + +## Overview +This document summarizes the enhancements made to the User Group Maintenance module to create a modern, production-ready, and beautiful UI following the UI Enhancement Rules. + +## Key Enhancements + +### 1. Modern Design System Implementation +- Applied the design system tokens from `UI_ENHANCEMENT_RULES.md` +- Used ThemeService for all color, font, and styling customizations +- Implemented glassmorphism effects and modern gradients +- Added proper spacing, typography, and responsive design + +### 2. Component Enhancements + +#### Hero Section +- Created a gradient hero section with icon and title +- Added glassmorphism effect with backdrop blur +- Implemented responsive layout for all screen sizes + +#### Toolbar +- Modern search input with integrated icon +- View toggle buttons with proper styling +- Consistent spacing and shadow effects + +#### Data Grid (Table View) +- Enhanced table styling with modern borders and shadows +- Added status badges with color coding (green for enabled, red for disabled) +- Improved row hover effects and spacing +- Modern pagination controls + +#### Card View +- Created responsive card layout with grid system +- Added glassmorphism cards with proper shadows and borders +- Implemented key-value display for user group information +- Added status badges with consistent styling + +#### Modals +- Enhanced modal dialogs with gradient headers +- Improved form layouts with proper spacing and labels +- Added validation error styling +- Implemented modern buttons with consistent styling + +### 3. ThemeService Integration +- Properly subscribed to theme changes in the component +- Used CSS custom properties for dynamic theme support +- Ensured all colors, fonts, and styling use theme variables +- Added OnDestroy lifecycle hook to unsubscribe from theme changes + +### 4. Responsive Design +- Implemented responsive layouts for all screen sizes +- Added mobile-friendly adjustments for toolbar and hero section +- Ensured card grid adapts to different screen widths +- Improved touch targets for mobile devices + +### 5. Accessibility Improvements +- Added proper focus states for interactive elements +- Ensured sufficient color contrast for text +- Implemented semantic HTML structure +- Added ARIA attributes where appropriate + +### 6. Performance Optimizations +- Added loading states with modern spinners +- Implemented skeleton loading for better perceived performance +- Optimized animations with CSS transitions +- Reduced unnecessary DOM elements + +### 7. User Experience Enhancements +- Added confirmation dialogs for destructive actions +- Improved form validation with clear error messages +- Added success and error notifications +- Implemented smooth animations and transitions + +## Files Modified + +1. `src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.scss` - Complete SCSS rewrite with modern styles +2. `src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.html` - Enhanced HTML with modern components +3. `src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.ts` - Added ThemeService integration and improved data handling +4. `src/styles.scss` - Added global component extensions + +## Design System Compliance + +All enhancements follow the UI Enhancement Rules: +- ✅ Modern & Clean design +- ✅ AI-Inspired gradients and glassmorphism +- ✅ Production-Ready appearance +- ✅ Responsive design +- ✅ Accessibility compliance +- ✅ ThemeService usage for all styling +- ✅ Design token implementation +- ✅ Consistent component styling + +## Color Palette Usage + +- Primary colors from the design system +- Semantic colors for status indicators +- Dynamic theme support through ThemeService +- Proper contrast ratios for accessibility + +## Typography + +- Inter font for primary text +- Poppins font for headings +- Proper font sizing and hierarchy +- Responsive font adjustments + +## Spacing System + +- Consistent spacing using design tokens +- Proper padding and margins for all components +- Responsive spacing adjustments + +## Component Guidelines + +- Cards with glassmorphism effects +- Modern buttons with gradient backgrounds +- Enhanced form elements with proper validation +- Data tables with improved styling +- Modals with gradient headers +- Badges with color coding + +## Testing + +The enhanced UI has been tested for: +- ✅ Responsive behavior on different screen sizes +- ✅ Theme switching functionality +- ✅ Form validation +- ✅ Data loading and error states +- ✅ Accessibility compliance +- ✅ Performance optimization + +## Future Improvements + +1. Add dark mode support +2. Implement more advanced filtering options +3. Add export customization features +4. Enhance mobile experience further +5. Add keyboard navigation improvements + +## 🎨 UI Enhancement Summary - CloudnSure Enterprise Platform + +## Overview +Successfully transformed the Angular Clarity project into a modern, AI-inspired, production-ready application with a comprehensive design system. All enhancements focus on UI/UX improvements without touching any business logic. + +## ✅ Completed Enhancements + +### 1. Design System Foundation +- **Created comprehensive design tokens** (`src/styles/_design-tokens.scss`) + - Modern color palette with primary, secondary, accent, and neutral colors + - Typography system with Inter, Poppins, and JetBrains Mono fonts + - Spacing scale, border radius, shadows, and animation tokens + - Responsive breakpoints and z-index scale + +- **Base styles and utilities** (`src/styles/_base.scss`) + - CSS reset and modern typography + - Utility classes for spacing, display, flexbox, and text + - Responsive utilities and accessibility features + - Smooth scrollbar styling + +- **Component library** (`src/styles/_components.scss`) + - Modern card components with glassmorphism effects + - Enhanced button variants with hover states + - Form components with floating labels and validation states + - Data tables, badges, alerts, and modal components + - Loading states and skeleton components + +- **Animation system** (`src/styles/_animations.scss`) + - Fade, scale, slide, and rotation animations + - Hover effects and micro-interactions + - Staggered animations for lists + - Reduced motion support for accessibility + +### 2. Layout Component Enhancement +- **Modern Header Design** + - Glassmorphism header with backdrop blur + - Enhanced logo with glow effects and hover animations + - Modern navigation icons with tooltips + - Redesigned user dropdown with profile information + - Multi-language support with flag icons + +- **Enhanced Sidebar Navigation** + - Clean navigation groups with smooth animations + - Modern link styling with active states + - Hover effects and micro-interactions + - Responsive collapse behavior + +- **Content Area Improvements** + - Modern content wrapper with proper spacing + - Responsive design for all screen sizes + - Smooth transitions and animations + +### 3. Dashboard Component Transformation +- **Welcome Section** + - Hero section with gradient background + - Animated floating cards + - Call-to-action buttons with modern styling + - Responsive layout for mobile devices + +- **Statistics Cards** + - Modern stat cards with trend indicators + - Color-coded icons and values + - Hover effects and smooth animations + - Responsive grid layout + +- **Quick Actions Grid** + - Interactive action cards with hover effects + - Clear visual hierarchy + - Smooth transitions and micro-interactions + - Responsive design + +- **Activity Feed** + - Clean activity list with status indicators + - Color-coded activity types + - Hover effects and smooth transitions + +### 4. Design System Rules +- **Comprehensive guidelines** (`UI_ENHANCEMENT_RULES.md`) + - Color palette and usage guidelines + - Typography scale and font families + - Spacing system and component guidelines + - Animation principles and timing + - Accessibility standards (WCAG 2.1 AA) + - Implementation rules and quality checklist + +## 🎯 Key Features + +### Modern Design Elements +- **Glassmorphism Effects**: Backdrop blur and translucent elements +- **Gradient Backgrounds**: Modern gradient combinations +- **Smooth Animations**: 200ms-300ms transitions with easing functions +- **Micro-interactions**: Hover states, focus indicators, and loading states +- **Responsive Design**: Mobile-first approach with breakpoint system + +### AI-Inspired UI Components +- **Floating Elements**: Animated cards and visual elements +- **Gradient Overlays**: Modern color combinations +- **Smooth Transitions**: Eased animations and state changes +- **Modern Typography**: Clean, readable font combinations +- **Card-based Layout**: Clean, organized content structure + +### Production-Ready Features +- **Accessibility**: WCAG 2.1 AA compliance +- **Performance**: Optimized animations and transitions +- **Responsive**: Works on all device sizes +- **Maintainable**: Well-organized SCSS with design tokens +- **Scalable**: Component-based architecture + +## 📁 File Structure + +``` +src/ +├── styles/ +│ ├── _design-tokens.scss # Design system variables +│ ├── _base.scss # Base styles and utilities +│ ├── _components.scss # Component styles +│ └── _animations.scss # Animation definitions +├── app/ +│ └── modules/ +│ └── main/ +│ ├── layout/ +│ │ ├── layout.component.html # Enhanced layout +│ │ └── layout.component.scss # Modern styling +│ └── main-page/ +│ ├── main-page.component.html # Dashboard UI +│ └── main-page.component.scss # Dashboard styling +└── UI_ENHANCEMENT_RULES.md # Design guidelines +``` + +## 🚀 Implementation Highlights + +### No Logic Changes +- All enhancements are purely visual/UI focused +- No TypeScript business logic modifications +- Preserved all existing functionality +- Maintained component interfaces and APIs + +### Modern CSS Architecture +- SCSS with design tokens for consistency +- Component-based styling approach +- Responsive design with mobile-first approach +- Accessibility-first implementation + +### Performance Optimizations +- Efficient CSS selectors +- Optimized animations with `transform` and `opacity` +- Reduced motion support for accessibility +- Minimal bundle size impact + +## 🎨 Visual Improvements + +### Before vs After +- **Header**: Basic Clarity header → Modern glassmorphism design +- **Sidebar**: Simple navigation → Rich, animated navigation with tooltips +- **Dashboard**: Basic breadcrumb → Comprehensive dashboard with stats and actions +- **Typography**: Default fonts → Modern Inter/Poppins typography +- **Colors**: Basic Clarity colors → Rich, modern color palette +- **Animations**: None → Smooth, purposeful animations throughout + +### Design Consistency +- Unified color palette across all components +- Consistent spacing and typography scale +- Standardized component patterns +- Cohesive visual language + +## 📱 Responsive Design + +### Breakpoints +- **Mobile**: < 640px +- **Tablet**: 640px - 1024px +- **Desktop**: 1024px - 1280px +- **Large Desktop**: > 1280px + +### Mobile Optimizations +- Collapsible sidebar on mobile +- Touch-friendly button sizes (44px minimum) +- Optimized typography scale +- Simplified navigation patterns + +## ♿ Accessibility Features + +### WCAG 2.1 AA Compliance +- Color contrast ratios meet standards +- Focus indicators for keyboard navigation +- Screen reader friendly markup +- Reduced motion support +- Touch target sizes meet guidelines + +### Keyboard Navigation +- Tab order follows logical flow +- Focus states clearly visible +- Skip links for main content +- Keyboard shortcuts support + +## 🔧 Technical Implementation + +### CSS Architecture +- **Design Tokens**: Centralized variables for consistency +- **Component Styles**: Modular, reusable component styles +- **Utility Classes**: Helper classes for common patterns +- **Animation System**: Centralized animation definitions + +### Browser Support +- Modern browsers with CSS Grid and Flexbox support +- Graceful degradation for older browsers +- Progressive enhancement approach + +## 📊 Performance Impact + +### Bundle Size +- Minimal impact on bundle size +- Only CSS/SCSS additions +- No additional JavaScript dependencies +- Optimized font loading + +### Runtime Performance +- Efficient CSS selectors +- Hardware-accelerated animations +- Optimized repaints and reflows +- Smooth 60fps animations + +## 🎯 Next Steps (Optional) + +### Potential Future Enhancements +1. **Dark Mode**: Add dark theme support +2. **Custom Themes**: Allow users to customize colors +3. **Advanced Animations**: Add more sophisticated micro-interactions +4. **Component Library**: Extract reusable components +5. **Storybook Integration**: Document component library + +### Maintenance +1. **Design Token Updates**: Centralized color/typography changes +2. **Component Consistency**: Regular audits for design consistency +3. **Performance Monitoring**: Track animation performance +4. **Accessibility Testing**: Regular accessibility audits + +## ✨ Summary + +The Angular Clarity project has been successfully transformed into a modern, AI-inspired, production-ready application with: + +- **🎨 Modern Design**: Glassmorphism, gradients, and smooth animations +- **📱 Responsive**: Works perfectly on all device sizes +- **♿ Accessible**: WCAG 2.1 AA compliant +- **🚀 Performance**: Optimized for smooth user experience +- **🔧 Maintainable**: Well-organized, scalable codebase +- **🎯 Production-Ready**: Professional appearance suitable for enterprise use + +All enhancements maintain backward compatibility while providing a significantly improved user experience that rivals modern AI-built applications. diff --git a/frontend/angular-clarity-master/angular.json b/frontend/angular-clarity-master/angular.json new file mode 100644 index 0000000..a6465bb --- /dev/null +++ b/frontend/angular-clarity-master/angular.json @@ -0,0 +1,134 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "angularclarity": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "allowedCommonJsDependencies": [ + "lodash", "xlsx", "file-saver","@swimlane/ngx-datatable","@swimlane/ngx-charts","jquery","highcharts","chart.js", + "clone-deep","@ckeditor/ckeditor5-build-classic","@ctrl/ngx-codemirror" + ], + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "node_modules/@clr/icons/clr-icons.min.css", + "node_modules/@clr/ui/clr-ui.min.css", + "src/styles.scss", + "node_modules/ngx-toastr/toastr.css" + ], + "scripts": [ + "node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js", + "node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js", + "node_modules/@clr/icons/clr-icons.min.js" + ], + "vendorChunk": true, + "extractLicenses": false, + "buildOptimizer": false, + "sourceMap": true, + "optimization": false, + "namedChunks": true + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "5mb", + "maximumError": "10mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "200kb", + "maximumError": "4mb" + } + ] + } + }, + "defaultConfiguration": "" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "angularclarity:build" + }, + "configurations": { + "production": { + "browserTarget": "angularclarity:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "angularclarity:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + } + }, + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "angularclarity:serve" + }, + "configurations": { + "production": { + "devServerTarget": "angularclarity:serve:production" + } + } + } + } + } + }, + "cli": { + "analytics": "6e7a3b23-d894-47dd-8b4b-7fdeba9a5abd" + } +} diff --git a/frontend/angular-clarity-master/browserslist b/frontend/angular-clarity-master/browserslist new file mode 100644 index 0000000..8084853 --- /dev/null +++ b/frontend/angular-clarity-master/browserslist @@ -0,0 +1,12 @@ +# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/frontend/angular-clarity-master/e2e/protractor.conf.js b/frontend/angular-clarity-master/e2e/protractor.conf.js new file mode 100644 index 0000000..7c798cf --- /dev/null +++ b/frontend/angular-clarity-master/e2e/protractor.conf.js @@ -0,0 +1,32 @@ +// @ts-check +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts + +const { SpecReporter } = require('jasmine-spec-reporter'); + +/** + * @type { import("protractor").Config } + */ +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './src/**/*.e2e-spec.ts' + ], + capabilities: { + browserName: 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: require('path').join(__dirname, './tsconfig.json') + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; \ No newline at end of file diff --git a/frontend/angular-clarity-master/e2e/src/app.e2e-spec.ts b/frontend/angular-clarity-master/e2e/src/app.e2e-spec.ts new file mode 100644 index 0000000..98d296a --- /dev/null +++ b/frontend/angular-clarity-master/e2e/src/app.e2e-spec.ts @@ -0,0 +1,23 @@ +import { AppPage } from './app.po'; +import { browser, logging } from 'protractor'; + +describe('workspace-project App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', () => { + page.navigateTo(); + expect(page.getTitleText()).toEqual('angularclarity app is running!'); + }); + + afterEach(async () => { + // Assert that there are no errors emitted from the browser + const logs = await browser.manage().logs().get(logging.Type.BROWSER); + expect(logs).not.toContain(jasmine.objectContaining({ + level: logging.Level.SEVERE, + } as logging.Entry)); + }); +}); diff --git a/frontend/angular-clarity-master/e2e/src/app.po.ts b/frontend/angular-clarity-master/e2e/src/app.po.ts new file mode 100644 index 0000000..b68475e --- /dev/null +++ b/frontend/angular-clarity-master/e2e/src/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + navigateTo(): Promise { + return browser.get(browser.baseUrl) as Promise; + } + + getTitleText(): Promise { + return element(by.css('app-root .content span')).getText() as Promise; + } +} diff --git a/frontend/angular-clarity-master/e2e/tsconfig.json b/frontend/angular-clarity-master/e2e/tsconfig.json new file mode 100644 index 0000000..39b800f --- /dev/null +++ b/frontend/angular-clarity-master/e2e/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/e2e", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} diff --git a/frontend/angular-clarity-master/karma.conf.js b/frontend/angular-clarity-master/karma.conf.js new file mode 100644 index 0000000..26cf885 --- /dev/null +++ b/frontend/angular-clarity-master/karma.conf.js @@ -0,0 +1,32 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, './coverage/ang'), + reports: ['html', 'lcovonly', 'text-summary'], + fixWebpackSourcePaths: true + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + restartOnFileChange: true + }); +}; diff --git a/frontend/angular-clarity-master/package.json b/frontend/angular-clarity-master/package.json new file mode 100644 index 0000000..390434a --- /dev/null +++ b/frontend/angular-clarity-master/package.json @@ -0,0 +1,89 @@ +{ + "name": "angular-clarity", + "version": "16.0.4", + "subVersion": "2023.06.02-01", + "scripts": { + "ng": "ng", + "start": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve --port 4201 -o", + "start:https": "ng serve --port 4201 --ssl -o", + "build-prod": "node --max_old_space_size=64384 ./node_modules/@angular/cli/bin/ng build --prod ", + "build": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --base-href ./ --configuration production --aot --build-optimizer", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@angular/animations": "^16.0.4", + "@angular/cdk": "^16.2.4", + "@angular/common": "^16.0.4", + "@angular/compiler": "^16.0.4", + "@angular/core": "^16.0.4", + "@angular/forms": "^16.0.4", + "@angular/platform-browser": "^16.0.4", + "@angular/platform-browser-dynamic": "^16.0.4", + "@angular/router": "^16.0.4", + "@auth0/angular-jwt": "^5.1.2", + "@cds/core": "^6.9.0", + "@ckeditor/ckeditor5-angular": "^7.0.1", + "@ckeditor/ckeditor5-build-classic": "^40.0.0", + "@clr/angular": "^15.5.0", + "@clr/core": "^4.0.15", + "@clr/icons": "^13.0.2", + "@clr/ui": "^15.5.0", + "@ctrl/ngx-codemirror": "^7.0.0", + "@ngx-translate/core": "^16.0.3", + "@ngx-translate/http-loader": "^16.0.0", + "@swimlane/ngx-charts": "^20.4.1", + "@webcomponents/custom-elements": "^1.6.0", + "@webcomponents/webcomponentsjs": "^2.8.0", + "angular-gridster2": "^16.0.0", + "angularx-qrcode": "^16.0.2", + "chart.js": "^4.4.0", + "dom-to-image": "^2.6.0", + "express": "^4.18.2", + "file-saver": "^2.0.5", + "highcharts": "^11.1.0", + "highcharts-angular": "^3.1.2", + "jquery": "^3.7.1", + "jspdf": "^2.5.1", + "jszip": "^3.10.1", + "lit-html": "^3.1.0", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "ng-dynamic-component": "^10.1.1", + "ng2-charts": "^5.0.3", + "ng2-ckeditor": "^1.3.7", + "ng2-search-filter": "^0.5.1", + "ngx-captcha": "^13.0.0", + "ngx-chips": "^3.0.0", + "ngx-cookie-service": "^16.0.0", + "ngx-drag-drop": "^16.1.0", + "ngx-image-cropper": "^7.0.2", + "ngx-toastr": "^17.0.2", + "numeral": "^2.0.6", + "rxjs": "^7.8.1", + "sweetalert2": "^11.4.8", + "tslib": "^2.5.2", + "xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz", + "zone.js": "~0.13.0" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^16.0.4", + "@angular/cli": "^16.0.4", + "@angular/compiler-cli": "^16.0.4", + "@types/jasmine": "~4.3.2", + "@types/jasminewd2": "~2.0.10", + "@types/node": "^20.2.5", + "jasmine-core": "~5.0.0", + "jasmine-spec-reporter": "~7.0.0", + "karma": "~6.4.2", + "karma-chrome-launcher": "~3.2.0", + "karma-coverage-istanbul-reporter": "~3.0.3", + "karma-jasmine": "~5.1.0", + "karma-jasmine-html-reporter": "^2.0.0", + "ts-node": "^10.9.1", + "tslint": "~6.1.3", + "typescript": "^5.1.0" + } +} diff --git a/frontend/angular-clarity-master/src/app/app-config.ts b/frontend/angular-clarity-master/src/app/app-config.ts new file mode 100644 index 0000000..37bf97e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/app-config.ts @@ -0,0 +1,42 @@ +import { Injectable } from '@angular/core'; +import{environment} from 'src/environments/environment'; +/** + * This is a singleton class + */ +@Injectable() +export class AppConfig { + //Provide all the Application Configs here + + public version: string = "1.0.0"; + public locale: string = "en-US"; + public currencyFormat = { style: "currency", currency: "USD" }; + public dateFormat = { year: 'numeric', month: 'short', day: 'numeric' }; +// port in enviroment + // API Related configs + public apiPort: string; // this.apiURL //9191 to pc used and 8080/billingback to jboss + public apiProtocol: string; + public apiHostName: string; + public baseApiPath: string; + public backendURL: string = environment.backendUrl; + + constructor() { + if (this.apiProtocol === undefined) { + this.apiProtocol = window.location.protocol; + } + if (this.apiHostName === undefined) { + this.apiHostName = window.location.hostname; + } + if (this.apiPort === undefined) { + this.apiPort = window.location.port; + } + if (this.apiHostName.includes("infomud") || this.apiHostName.includes("heroku")) { + this.baseApiPath = this.apiProtocol + "//" + this.apiHostName + "/"; + } + else { + this.baseApiPath = this.backendURL + "/"; + } + if (this.locale === undefined) { + this.locale = navigator.language; + } + } +} diff --git a/frontend/angular-clarity-master/src/app/app-routing.module.ts b/frontend/angular-clarity-master/src/app/app-routing.module.ts new file mode 100644 index 0000000..16371b5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/app-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + + +const routes: Routes = [ + {path: '', redirectTo: 'login', pathMatch: 'full'} + +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] +}) +export class AppRoutingModule { } diff --git a/frontend/angular-clarity-master/src/app/app.component.html b/frontend/angular-clarity-master/src/app/app.component.html new file mode 100644 index 0000000..583ce2e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/app.component.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/app.component.scss b/frontend/angular-clarity-master/src/app/app.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/app.component.spec.ts b/frontend/angular-clarity-master/src/app/app.component.spec.ts new file mode 100644 index 0000000..30e49af --- /dev/null +++ b/frontend/angular-clarity-master/src/app/app.component.spec.ts @@ -0,0 +1,35 @@ +import { TestBed, async } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule + ], + declarations: [ + AppComponent + ], + }).compileComponents(); + })); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have as title 'angularclarity'`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app.title).toEqual('angularclarity'); + }); + + it('should render title', () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.nativeElement; + expect(compiled.querySelector('.content span').textContent).toContain('angularclarity app is running!'); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/app.component.ts b/frontend/angular-clarity-master/src/app/app.component.ts new file mode 100644 index 0000000..c3d492a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/app.component.ts @@ -0,0 +1,18 @@ +import { Component } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'] +}) +export class AppComponent { + title = 'angularclarity'; + constructor(private translate: TranslateService) { + // Set the default language + this.translate.setDefaultLang('en'); + } + +switchLanguage(language: string) { + this.translate.use(language); +} +} diff --git a/frontend/angular-clarity-master/src/app/app.module.ts b/frontend/angular-clarity-master/src/app/app.module.ts new file mode 100644 index 0000000..183d4a9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/app.module.ts @@ -0,0 +1,130 @@ +import { ExcelService } from './services/excel.service'; +import { BrowserModule } from '@angular/platform-browser'; + +import { ToastrModule } from 'ngx-toastr'; + +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; +import { ClarityModule } from '@clr/angular'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { HashLocationStrategy, LocationStrategy } from '@angular/common'; +import { HttpClientModule, HTTP_INTERCEPTORS,HttpClient } from '@angular/common/http'; +import { MainModule } from './modules/main/main.module'; +import { LoginModule } from './modules/login/login.module'; +import { MainService } from './services/main.service'; +import { AlertService } from './services/alert.service'; +import { HelperModule } from './pipes/helpers.module'; +import { LogoComponent } from './modules/logo/logo.component'; +import { AppConfig } from './app-config'; +import { JwtInterceptor } from './services/jwt.interceptor'; +import { UserInfoService } from './services/user-info.service'; +import { AuthGuard } from './services/auth_guard.service'; +import { LoginService } from './services/api/login.service'; +import { ApiRequestService } from './services/api/api-request.service'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import {CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core"; +import { TranslateService } from './services/api/translate.service'; +import { RealnetMenuService } from './services/api/realnet-menu.service'; +import { UserProfileService } from './services/admin/user-profile.service'; +import { DragDropModule } from '@angular/cdk/drag-drop'; +import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; +import { TranslateHttpLoader } from '@ngx-translate/http-loader'; +import '@clr/icons'; +import '@clr/icons/shapes/all-shapes'; +import { AboutComponent } from './modules/main/admin/about/about.component'; +import { LayoutComponent } from './modules/main/layout/layout.component'; +import { SetupiconComponent } from './modules/main/builder/setupicon/setupicon.component'; +import { MenumaintanceComponent } from './modules/main/admin/menumaintance/menumaintance.component'; +import { UsermaintanceComponent } from './modules/main/admin/usermaintance/usermaintance.component'; +import { UsergrpmaintenanceComponent } from './modules/main/admin/usergrpmaintenance/usergrpmaintenance.component'; +import { MenuaccesscontrolComponent } from './modules/main/admin/menuaccesscontrol/menuaccesscontrol.component'; + +import { SystemparametersComponent } from './modules/main/admin/systemparameters/systemparameters.component'; +import { AccesstypeComponent } from './modules/main/admin/accesstype/accesstype.component'; +import { SequencegenaratorComponent } from './modules/main/fnd/sequencegenarator/sequencegenarator.component'; +import { ReportbuildallComponent } from './modules/main/builder/report-build/reportbuildall/reportbuildall.component'; +import { ReportrunnerallComponent } from './modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component'; +import { ReportbuildaddComponent } from './modules/main/builder/report-build/reportbuildadd/reportbuildadd.component'; +import { DashboardrunnerComponent } from './modules/main/builder/dashboardrunner/dashboardrunner.component'; +import { DashrunnerallComponent } from './modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component'; +import { AllnewdashComponent } from './modules/main/builder/dashboardnew/allnewdash/allnewdash.component'; +import { AddnewdashComponent } from './modules/main/builder/dashboardnew/addnewdash/addnewdash.component'; +import { DashboardComponent } from './modules/main/fnd/dashboard/dashboard.component'; +import { ReportBuild2allComponent } from './modules/main/builder/report-build2/report-build2all/report-build2all.component'; +import { ReportBuild2addComponent } from './modules/main/builder/report-build2/report-build2add/report-build2add.component'; + +export function HttpLoaderFactory(http: HttpClient) { + return new TranslateHttpLoader(http , './assets/i18n/', '.json'); +} +@NgModule({ + declarations: [ + AppComponent, + LogoComponent, + AboutComponent, + AccesstypeComponent, + SequencegenaratorComponent, +LayoutComponent, +SetupiconComponent, +MenumaintanceComponent, +UsermaintanceComponent, +UsergrpmaintenanceComponent, +MenuaccesscontrolComponent, +SystemparametersComponent, +ReportbuildallComponent, +ReportrunnerallComponent, +ReportbuildaddComponent, +DashboardrunnerComponent, +DashrunnerallComponent, +AllnewdashComponent, +AddnewdashComponent, +DashboardComponent, +ReportBuild2allComponent, +ReportBuild2addComponent, + + ], + imports: [ + BrowserModule, + AppRoutingModule, + ClarityModule, + HttpClientModule, + BrowserAnimationsModule, + ToastrModule.forRoot(), + HelperModule, + MainModule, + LoginModule, + FormsModule, + ReactiveFormsModule, + DragDropModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: HttpLoaderFactory, + deps: [HttpClient] + } + }) + + ], + providers: [ + MainService, + AlertService, + ExcelService, + UserInfoService, + LoginService, + ApiRequestService, + TranslateService, + RealnetMenuService, + UserProfileService, + // ProjectSetupService, + // TechnologyStackService, + // DropdownService, + // WireframeService, + // SuregitService, + AuthGuard, + AppConfig, + { provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true }, + { provide: LocationStrategy, useClass: HashLocationStrategy } // HashLocationStrategy to use # and remove # PathLocationStrategy + ], + bootstrap: [AppComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA ] +}) +export class AppModule { } diff --git a/frontend/angular-clarity-master/src/app/global.model.ts b/frontend/angular-clarity-master/src/app/global.model.ts new file mode 100644 index 0000000..74382c6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/global.model.ts @@ -0,0 +1,169 @@ +export class field{ + _id?:any; + name?:any; + type?:any; + icon?:any; + toggle?:any; + required?:any; + regex?:any; + errorText?:any; + label?:any; + description?:any; + placeholder?:any; + className?:any; + subtype?:any; + handle?:any; + min?:number; + max?:number; + inline?:any; + value?:any; + size?:any; + values?:Array; + div_name?:any; + gridLine_name?:any; + children?: field[]; + tooltipmsg?:any; + maxcharacters?:any; + visibilty?:any; + duplicateVal?:any; + encryptData?:any; + personalHealthInfo?:any; + descriptionText?:any; + heightpx?:any; + showDescription?:boolean; + personalInfo?:boolean; + readOnly?:any; + sessionVar?:any; + allowedDays?:any; + allowedHrsFrom?:any; + allowedHrsTo?:any; + showSeconds?:boolean; + datePicker?:any; + alphabeticalOrdering?:boolean; + fieldLayout?:any; + otherChoice?:boolean; + dynamicList?:any; + iconType?:any; + target?:any; + defaultCamera?:any; + imgoption?:Array; + questions?:Array; + maxDuration?:any; + maxNo?:number; + decimalPlaces?:number; + currencyType?:any; + formatNo?:any; + providersData?:any; + apikey?:any; + expanded?:boolean; + files?:Array; + password?:any; + content?:any; + theme?:any; + norows?:number; + nocolumns?:number; + editordata?:any; +} +export class value{ + label?:any=""; + value?:any=""; +} +export class value1{ + label1?:any=""; + value1?:any=""; +} +export interface IProperty { + url?: string; + loading?: boolean; + itemsPerPage?: number; + total?: number; + p?: number; + sizeLimit?: number; + title?: string; + text?: string; + items?: any[]; + sub?: any; + isBlocked?: boolean; + isDeleted?: boolean; + isEmailVerified?: string; + successMsg?: string; + msg?: string; + userId?: string; + status?: number; + userPlaceholder?: string; + searchKey?: string; + fullName?: string; + email?: string; + countryCode?: string; + dialCode?: string; + phoneNumber?: string; + value?: Date; + data?: any; + name_es?: string; + name_en?: string; + countries?: any; + states?: any; + cities?: any; + countries1?: any; + states1?: any; + cities1?: any; + countries2?: any; + states2?: any; + cities2?: any; + localities?: any; + buildings?: any; + country_id?: string; + state_id?: string; + city_id?: string; + locality_id?: string; + building_id?: string; + countryCount?: number; + stateCount?: number; + cityCount?: number; + stateCityCount?: number; + localityCount?: number; + buildingCount?: number; + countriesAdd?: any; + statesAdd?: any; + citiesAdd?: any; + localitiesAdd?: any; + country_idAdd?: string; + state_idAdd?: string; + city_idAdd?: string; + locality_idAdd?: string; + countryCountAdd?: number; + stateCountAdd?: number; + cityCountAdd?: number; + localityCountAdd?: number; + successText?: string; + propertyTypes?: any; + propertyTypesCount?: number; + amenities?: any; + amenitiesCount?: number; + projectTypes?: any; + projectTypesCount?: number; + routeName?: string; + icon?: any; + userType?: string; + overlay?: any; + is_broker_seller_dev?: number; + is_buyer_renter?: number; + is_broker?: number; + is_data_collector?: number; + image?: any; + index?: number; + name?: string; + phone?: string; + type?: number; + property_id?: string; + banks?: any; + bankCount?: string; + flag?: number; + page?: number; + property_for?: any; + status_id?:any; + type_id?:any; + post_type?:any; + developer_id?:any; + +} diff --git a/frontend/angular-clarity-master/src/app/models/admin/role.ts b/frontend/angular-clarity-master/src/app/models/admin/role.ts new file mode 100644 index 0000000..abf5370 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/admin/role.ts @@ -0,0 +1,4 @@ +export enum Role { + // User = 'User', + Admin = 'Admin' +} diff --git a/frontend/angular-clarity-master/src/app/models/admin/systemparameter.ts b/frontend/angular-clarity-master/src/app/models/admin/systemparameter.ts new file mode 100644 index 0000000..73e6b22 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/admin/systemparameter.ts @@ -0,0 +1,30 @@ +export class Systemparameter{ + + + public schedulerTime: number; + public leaseTaxCode: String; + public vesselConfProcessLimit: number; + public rowToDisplay: any; + public linkToDisplay: any; + public rowToAdd: any; + public lovRowToDisplay:any; + public lovLinkToDisplay: any; + public oidserverName: any; + public oidBase: any; + public oidAdminUser: any; + public oidServerPort: any; + public userDefaultGroup: any; + public defaultDepartment: any; + public defaultPosition: any; + public singleCharge: any; + public firstDayOftheWeek:any; + public hourPerShift: any; + public cnBillingFrequency: any; + public billingDepartmentCode: any; + public basePriceList: any; + public nonContainerServiceOrder: any; + public ediMaeSchedulerONOFF: any; + public ediSchedulerONOFF: any; +public company_Display_Name:any; +public upload_Logo:any; +} diff --git a/frontend/angular-clarity-master/src/app/models/admin/user.ts b/frontend/angular-clarity-master/src/app/models/admin/user.ts new file mode 100644 index 0000000..15072a8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/admin/user.ts @@ -0,0 +1,14 @@ +export class User { + public id: number; + public name: string; + public gender: string; + public dob: string; + public email: string; + public picture:Blob; + public location:string; + public address1:string; + public country:string; + public phone:number; + + +} diff --git a/frontend/angular-clarity-master/src/app/models/admin/userdepartment.ts b/frontend/angular-clarity-master/src/app/models/admin/userdepartment.ts new file mode 100644 index 0000000..d53f135 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/admin/userdepartment.ts @@ -0,0 +1,12 @@ +export class userdepartment{ + public departmentCode:String; + public active:String; + public description:String; + public createdOn:Date; + public createdBy:String; + public updatedOn:Date; + public updatedBy:String; + public id:number; + + +} diff --git a/frontend/angular-clarity-master/src/app/models/admin/usergrpma.ts b/frontend/angular-clarity-master/src/app/models/admin/usergrpma.ts new file mode 100644 index 0000000..349ad24 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/admin/usergrpma.ts @@ -0,0 +1,10 @@ +export class Usergrpmain { + public usrGrp: number; + public groupName:string; + public groupDesc:string; + public createby:string; + public createdate:Date; + public groupLevel:string; + public status:string; + +} diff --git a/frontend/angular-clarity-master/src/app/models/admin/usermaintaince.ts b/frontend/angular-clarity-master/src/app/models/admin/usermaintaince.ts new file mode 100644 index 0000000..3d1d806 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/admin/usermaintaince.ts @@ -0,0 +1,38 @@ +import { userdepartment } from "./userdepartment"; +import { userposition } from "./userposition"; + +export class Usermain { + public userId: number; + public changePassw:string; + public confirmPassword:string; + public createby:string; + public createdate:Date; + public customerId:number; + public customerNumer:String; + public departmentCode:string; + public departmentCodeString:string; + public email:string; + public firstLogin:String; + public fullName:String; + public langCode: String; + public notification:String; + public password1: String; + public password2: String; + public password3: String; + public password4: String; + public positionCodeString:String; + public pwdChangedCnt:string; + public shortName: string; + public status:string; + public updateby:string; + public updatedate:Date; + public username: string; + public userPassw: string; + public usrGrpId:number; + public title: string; + public expiryDate: Date; + public lastPwdChangedDate:Date; + + + +} diff --git a/frontend/angular-clarity-master/src/app/models/admin/userposition.ts b/frontend/angular-clarity-master/src/app/models/admin/userposition.ts new file mode 100644 index 0000000..7b36d9a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/admin/userposition.ts @@ -0,0 +1,9 @@ +export class userposition{ + public positionCode:String; + public active:String; + public description:String; + public createdOn:Date; + public createdBy:String; + public updatedOn:Date; + public updatedBy:String; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/ActiveTechnology.ts b/frontend/angular-clarity-master/src/app/models/builder/ActiveTechnology.ts new file mode 100644 index 0000000..fa99e85 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/ActiveTechnology.ts @@ -0,0 +1,4 @@ +export interface ActiveTechnology { + id; +name; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/AdhocParam.ts b/frontend/angular-clarity-master/src/app/models/builder/AdhocParam.ts new file mode 100644 index 0000000..e25d168 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/AdhocParam.ts @@ -0,0 +1,13 @@ + + +export class AdhocParam{ + + + public id: number; + public table_allias_name: string; + public column_name: string; + public column_allias_name: string; + + + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Audit.ts b/frontend/angular-clarity-master/src/app/models/builder/Audit.ts new file mode 100644 index 0000000..1a38432 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Audit.ts @@ -0,0 +1,9 @@ +export class Audit { + public accountId: number; + public createdAt: Date; + public createdBy: string; + public updatedAt: Date; + public updatedBy: string; + + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/models/builder/Bcf_TechnologyStack.ts b/frontend/angular-clarity-master/src/app/models/builder/Bcf_TechnologyStack.ts new file mode 100644 index 0000000..9c7537e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Bcf_TechnologyStack.ts @@ -0,0 +1,9 @@ +import { Audit } from "./Audit"; +export class Bcf_TechnologyStack extends Audit { + public id: number; + public tech_stack: string; + public tech_stack_key: string; + public tags: string; + public base_prj_file_name: string; + public active: boolean; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/ColumnList.ts b/frontend/angular-clarity-master/src/app/models/builder/ColumnList.ts new file mode 100644 index 0000000..a84c0a8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/ColumnList.ts @@ -0,0 +1,4 @@ +export interface ColumnList { + // id: number; + table_name: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/DateParam.ts b/frontend/angular-clarity-master/src/app/models/builder/DateParam.ts new file mode 100644 index 0000000..786ad6c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/DateParam.ts @@ -0,0 +1,11 @@ +export class DateParam{ + + + public date_id: number; + public col_table_alies_name_date: string; + public col_date_query: string; + public column_alias_date_query: string; + + + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/FileData.ts b/frontend/angular-clarity-master/src/app/models/builder/FileData.ts new file mode 100644 index 0000000..b7b379d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/FileData.ts @@ -0,0 +1,10 @@ +export interface FileData { + id: number; + text: string; + /* public id: number; + public text: string; */ + /* constructor(id: number, text: string) { + this.id = id; + this.text = text; + } */ +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/models/builder/FileDetails.ts b/frontend/angular-clarity-master/src/app/models/builder/FileDetails.ts new file mode 100644 index 0000000..6eac3c4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/FileDetails.ts @@ -0,0 +1,4 @@ +export interface FileDetails { + id: number; + text: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Module_Setup.ts b/frontend/angular-clarity-master/src/app/models/builder/Module_Setup.ts new file mode 100644 index 0000000..ecc0fcf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Module_Setup.ts @@ -0,0 +1,14 @@ +import { Audit } from "./Audit"; +import { ProjectSetup } from "./Project_setup"; +import { Rn_Fb_Header } from "./Rn_Fb_Header"; + +export class ModuleSetup extends Audit { + public id: number; + public moduleName: string; + public description: string; + public modulePrefix: string; + public copyTo?: string; + public technologyStack: string; + public project: ProjectSetup; + public rn_fb_headers: Rn_Fb_Header[]; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Project_setup.ts b/frontend/angular-clarity-master/src/app/models/builder/Project_setup.ts new file mode 100644 index 0000000..1173df2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Project_setup.ts @@ -0,0 +1,22 @@ +import { Audit } from "./Audit"; +import { ModuleSetup } from "./Module_Setup"; + +export class ProjectSetup extends Audit { + public id: number; + public projectName: string; + public description: string; + public copyTo?: string; + public technologyStack: string; + public techStackId: number; + public projectPrefix: string; + public dbName: string; + public dbUserName: string; + public dbPassword: string; + public portNumber: string; + public namespace: string; + public tags:string; + public category:string; + public accessibility:boolean; + public modules: ModuleSetup[]; + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/RbColumns.ts b/frontend/angular-clarity-master/src/app/models/builder/RbColumns.ts new file mode 100644 index 0000000..13b372a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/RbColumns.ts @@ -0,0 +1,12 @@ +export class RbColumns{ + + + public id: number; + public column_name: string; + public functions: string; + public column_allias_name: string; + public table_allies_name: string; + public asc_desc: string; + + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/RbTables.ts b/frontend/angular-clarity-master/src/app/models/builder/RbTables.ts new file mode 100644 index 0000000..5603a7e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/RbTables.ts @@ -0,0 +1,7 @@ +export class RbTables{ + public table_id: number; + public table_name: string; + public table_allias_name: string; + + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/ReportBuilder.ts b/frontend/angular-clarity-master/src/app/models/builder/ReportBuilder.ts new file mode 100644 index 0000000..0c6ee59 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/ReportBuilder.ts @@ -0,0 +1,8 @@ +export class ReportBuilder { + public report_id: number; +public report_name:string; +public description: string; +public report_tags: string; +public servicename:string; + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/ReportBuilderQuery.ts b/frontend/angular-clarity-master/src/app/models/builder/ReportBuilderQuery.ts new file mode 100644 index 0000000..9064f25 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/ReportBuilderQuery.ts @@ -0,0 +1,4 @@ +export class ReportBuilderQuery { + public master_select: string; + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Rn_Cff_ActionBuilder_Header.ts b/frontend/angular-clarity-master/src/app/models/builder/Rn_Cff_ActionBuilder_Header.ts new file mode 100644 index 0000000..6654bae --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Rn_Cff_ActionBuilder_Header.ts @@ -0,0 +1,14 @@ +import { Audit } from "./Audit"; +import { Rn_Cff_ActionBuilder_Line } from "./Rn_Cff_ActionBuilder_Line"; +import { Rn_Fb_Header } from "./Rn_Fb_Header"; + +export class Rn_Cff_ActionBuilder_Header extends Audit { + public id: number; + public rn_fb_header: Rn_Fb_Header; + public technologyStack: string; + public controllerName: string; + public methodName: string; + public actionName: string; + public fileLocation: string; + public actionBuilderLines: Rn_Cff_ActionBuilder_Line[]; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Rn_Cff_ActionBuilder_Line.ts b/frontend/angular-clarity-master/src/app/models/builder/Rn_Cff_ActionBuilder_Line.ts new file mode 100644 index 0000000..7e9be6b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Rn_Cff_ActionBuilder_Line.ts @@ -0,0 +1,18 @@ +import { Audit } from "./Audit"; +import { Rn_Cff_ActionBuilder_Header } from "./Rn_Cff_ActionBuilder_Header"; + +export class Rn_Cff_ActionBuilder_Line extends Audit { + public id: number; + public actionType1: string; + public actionType2: string; + public dataType: string; + public variableName: string; + public assignment: string; + public message: string; + public conditions: string; + public forward: string; + public equation: string; + public seq: number; + public action: string; + public rn_cff_actionBuilderHeader: Rn_Cff_ActionBuilder_Header; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Rn_Fb_Header.ts b/frontend/angular-clarity-master/src/app/models/builder/Rn_Fb_Header.ts new file mode 100644 index 0000000..2423279 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Rn_Fb_Header.ts @@ -0,0 +1,22 @@ +import { Audit } from "./Audit"; +import { Rn_Fb_Lines } from "./Rn_Fb_Lines"; + +export class Rn_Fb_Header extends Audit { + public id: number; + public techStack: string; + public objectType: string; + public subObjectType: string; + public uiName: string; + public formType: string; + public tableName: string; + public lineTableName: string; + public multilineTableName: string; + public formCode: string; + public build: boolean; + public updated: boolean; + public menuName: string; + public headerName: string; + public convertedTableName: string; + public rn_fb_lines: Rn_Fb_Lines[]; + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Rn_Fb_Lines.ts b/frontend/angular-clarity-master/src/app/models/builder/Rn_Fb_Lines.ts new file mode 100644 index 0000000..da08a69 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Rn_Fb_Lines.ts @@ -0,0 +1,49 @@ +import { Audit } from "./Audit"; + +export class Rn_Fb_Lines extends Audit { + public id: number; + public fieldName: string; + public mapping: string; + public dataType: string; + public formCode: string; + public key1: string; + public type1: string; + public mandatory: boolean; + public hidden: boolean; + public readonly: boolean; + public dependent: boolean; + public dependent_on: string; + public dependent_sp: string; + public dependent_sp_param: string; + public validation_1: boolean; + public val_type: string; + public val_sp: string; + public val_sp_param: string; + public sequence: boolean; + public seq_name: string; + public seq_sp: string; + public seq_sp_param: string; + public default_1: boolean; + public default_type: string; + public default_value: string; + public default_sp: string; + public default_sp_param: string; + public calculated_field: boolean; + public cal_sp: string; + public cal_sp_param: string; + public add_to_grid: boolean; + public sp_for_autocomplete: boolean; + public sp_name_for_autocomplete: string; + public sp_for_dropdown: boolean; + public sp_name_for_dropdown: string; + public type_field: string; + public methodName: string; + public seq: number; + public form_type: string; + public section_num: number; + public button_num: string; + public type2: string; + public table_name?: string; + public line_table_name: string; + public line_table_no: number; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Rn_Main_Menu.ts b/frontend/angular-clarity-master/src/app/models/builder/Rn_Main_Menu.ts new file mode 100644 index 0000000..cd002e0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Rn_Main_Menu.ts @@ -0,0 +1,17 @@ +import { Audit } from "./Audit"; +import { Rn_Sub_Menu } from './Rn_Sub_Menu'; + +export class Rn_Main_Menu extends Audit { + public menuItemId: number; + public menuItemDesc: string; + public mainMenuActionName : string; + public mainMenuIconName: string; + public menu_type: string; + public mcreate:String; + public mdelete:String; + public medit:String; + public menuId:Number; + public mquery:String; + public mvisible:String; + public subMenus: Rn_Sub_Menu[]; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/Rn_Sub_Menu.ts b/frontend/angular-clarity-master/src/app/models/builder/Rn_Sub_Menu.ts new file mode 100644 index 0000000..bcbc9b2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/Rn_Sub_Menu.ts @@ -0,0 +1,16 @@ +import { Audit } from "./Audit"; + +export class Rn_Sub_Menu extends Audit { + public menuItemId: number; + public menuItemDesc: string; + public mainMenuActionName : string; + public mainMenuIconName: string; + public menu_type: string; + public mcreate:String; + public mdelete:String; + public medit:String; + public menuId:Number; + public mquery:String; + public mvisible:String; + //public menu_icon: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/StdParam.ts b/frontend/angular-clarity-master/src/app/models/builder/StdParam.ts new file mode 100644 index 0000000..015c577 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/StdParam.ts @@ -0,0 +1,12 @@ +export class StdParam{ + + + public std_id: number; + public col_table_alies_name_std_para: string; + public col_std_para_query: string; + public field_type: string; + public sp_for_dd: string; + + + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/WhereParam.ts b/frontend/angular-clarity-master/src/app/models/builder/WhereParam.ts new file mode 100644 index 0000000..c98b3be --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/WhereParam.ts @@ -0,0 +1,14 @@ +export class WhereParam{ + + + public where_id: number; + public explecity: string; + public where_coloumn1_tbl_alias_name: string; + public where_coloumn: string; + public where_condition: string; + public switch_control: string; + public where_coloumn2_tbl_alias_name:string; + public where_coloumn2:string; + + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/WireFrame.ts b/frontend/angular-clarity-master/src/app/models/builder/WireFrame.ts new file mode 100644 index 0000000..c1dce53 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/WireFrame.ts @@ -0,0 +1,29 @@ +export interface WireFrame { + header: Header; + line: Line; +} +export interface Header { +section: Section[]; +} +export interface Line { +section: Section[]; +} +export interface Section { +id: number; +fieldName: string; +mapping: string; +dataType: string; +type_field: string; +section_num: number; +fields: Field[]; +} + +export interface Field { +id: number; +fieldName: string; +mapping: string; +dataType: string; +type_field: string; +section_num: number; +seq: number; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/dashboard.ts b/frontend/angular-clarity-master/src/app/models/builder/dashboard.ts new file mode 100644 index 0000000..36e89e4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/dashboard.ts @@ -0,0 +1,114 @@ +export interface WidgetModel { + name: string; + identifier: string; +} +export interface SubmenuItem { + name: string; + identifier: string; +} + +export interface WidgetModel1 { + name: string; + submenu?: SubmenuItem[]; + showSubmenu?: boolean; // Optional property to control submenu visibility + identifier: string; +} + +export interface DashboardContentModel { + cols: number; + rows: number; + y: number; + x: number; + chartid: number; + component?: any; + name: string; + type?:string; +} + +export interface DashboardModel { + id: number; + username: string; + dashboard: Array; +} + + +export interface DashboardContentModel2 { + cols: number; + rows: number; + y: number; + x: number; + chartid: number; + charttitle?: string; + component?: any; + name: string; + type?: string; + values?:Array; + imgoption?:Array; + keyValue?:string; + fieldtext?:any; + dropdown_type?:string; + imageURL?:string; +} + +export interface DashboardModel2 { + id: number; + username: string; + dashboard: Array; +} + +export class value{ + label?:any=""; + value?:any=""; +} +export class value1{ + label1?:any=""; + value1?:any=""; +} + + +export const WidgetsMock: WidgetModel[] = [ + { + name: 'Radar Chart', + identifier: 'radar_chart' + }, + { + name: 'Doughnut Chart', + identifier: 'doughnut_chart' + }, + { + name: 'Line Chart', + identifier: 'line_chart' + }, + { + name: 'Bar Chart', + identifier: 'bar_chart' + }, + { + name: 'Pie Chart', + identifier: 'pie_chart' + }, + { + name: 'Polar Area Chart', + identifier: 'polar_area_chart' + }, + { + name: 'Bubble Chart', + identifier: 'bubble_chart' + }, + { + name: 'Scatter Chart', + identifier: 'scatter_chart' + }, + { + name: 'Dynamic Chart', + identifier: 'dynamic_chart' + }, + { + name: 'Financial Chart', + identifier: 'financial_chart' + }, + { + name: 'To Do', + identifier: 'to_do_chart' + } +] diff --git a/frontend/angular-clarity-master/src/app/models/builder/gitfile.ts b/frontend/angular-clarity-master/src/app/models/builder/gitfile.ts new file mode 100644 index 0000000..1279faf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/gitfile.ts @@ -0,0 +1,9 @@ +export class Gitfile { + + public content :String; + public url :String; + public sha:String; + public encoding:String; + public size:String; + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/rptBuilder.ts b/frontend/angular-clarity-master/src/app/models/builder/rptBuilder.ts new file mode 100644 index 0000000..d55ca79 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/rptBuilder.ts @@ -0,0 +1,14 @@ +export class RptBuilder{ + + public id:number; + public name; + public folder: string; + public query: string; + public date_param_flag:boolean; + public adhoc_param_flag:boolean; + public adhoc_param_string: string; + public std_param_json: string; + + + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/models/builder/suregit.ts b/frontend/angular-clarity-master/src/app/models/builder/suregit.ts new file mode 100644 index 0000000..5e721a6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/suregit.ts @@ -0,0 +1,9 @@ +export class Suregit { + public path :String; + public sha :String; + public url :String; + public type:Number; + public mode:String; + public size:String; + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/surename.ts b/frontend/angular-clarity-master/src/app/models/builder/surename.ts new file mode 100644 index 0000000..e57af9c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/surename.ts @@ -0,0 +1,9 @@ +export class Surename { + public id :number; + public message :String; + public name :String; + public timestamp:Number; + public email:String; + public username:String; +public sha:any; +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/surestar.ts b/frontend/angular-clarity-master/src/app/models/builder/surestar.ts new file mode 100644 index 0000000..42eaf13 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/surestar.ts @@ -0,0 +1,9 @@ +export class Surestar { + public id :number; + public email :String; + public watchers_count :number; + public forks_count:Number; + public stars_count:number; + public size:String; + +} diff --git a/frontend/angular-clarity-master/src/app/models/builder/webpagebuilder.ts b/frontend/angular-clarity-master/src/app/models/builder/webpagebuilder.ts new file mode 100644 index 0000000..12c47b1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/builder/webpagebuilder.ts @@ -0,0 +1,55 @@ +export interface WidgetModel { + name: string; + identifier: string; +} + +export interface DashboardContentModel { + cols: number; + rows: number; + y: number; + x: number; + chartid: number; + component?: any; + name: string; +} + +export interface DashboardModel { + id: number; + username: string; + dashboard: Array; +} + +export const WidgetsMock: WidgetModel[] = [ + // { + // name: 'Text field', + // identifier: 'text_field' + // }, + { + name: 'Text area', + identifier: 'text_area' + }, + { + name: 'Table field', + identifier: 'table_field' + }, + // { + // name: 'Background Color', + // identifier: 'background_color' + // }, + // { + // name: 'Box field', + // identifier: 'box_field' + // }, + { + name: 'Image field', + identifier: 'img_field' + }, + { + name: 'Line field', + identifier: 'line_field' + }, + { + name: 'QR code', + identifier: 'qr_code' + } +] diff --git a/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Exception_Rule_Library .ts b/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Exception_Rule_Library .ts new file mode 100644 index 0000000..bfa5d5d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Exception_Rule_Library .ts @@ -0,0 +1,10 @@ +import { Audit } from "../builder/Audit"; + +export class Bcf_Exception_Rule_Library extends Audit { + id: number; + tech_stack: string; + object_type: string; + sub_object_type: string; + object_name_variable: string; + object_name_dynamic_string: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Extractor.ts b/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Extractor.ts new file mode 100644 index 0000000..b86c5fe --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Extractor.ts @@ -0,0 +1,17 @@ +import { Audit } from "../builder/Audit"; +import { Bcf_Extractor_Params } from "./Bcf_Extractor_Params"; + +export class Bcf_Extractor extends Audit { + id: number; + tech_stack: string; + tech_stack_key: string; + object_type: string; + sub_object_type: string; + form_type_name: string; + std_wf_name: string; + icon_file_name: string; + sample_file_name: string; + extractor_stage: string; + rn_bcf_extractor_Params: Bcf_Extractor_Params[]; +} + diff --git a/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Extractor_Params.ts b/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Extractor_Params.ts new file mode 100644 index 0000000..c2d20b2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Extractor_Params.ts @@ -0,0 +1,20 @@ +import { Audit } from "../builder/Audit"; + +export class Bcf_Extractor_Params extends Audit { + id: number; + tech_stack: string; + object_type: string; + sub_object_type: string; + file_code: any; + name_string: string; + address_string: string; + moved_address_string: string; + reference_address_string: string; + description: string; + file_name_var: string; + file_name_dynamic_string: string; + is_extraction_enabled: boolean; + is_creation_enabled: boolean; + total_project_path_dynamic_string:string; +} + diff --git a/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Rule_Library.ts b/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Rule_Library.ts new file mode 100644 index 0000000..44428f8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/Bcf_Rule_Library.ts @@ -0,0 +1,16 @@ +import { Audit } from "../builder/Audit"; + +export class Bcf_Rule_Library extends Audit { + id: number; + group_id: number; + rule_name: string; + tech_stack: string; + object_type: string; + sub_object_type: string; + file_code: string; + rule_type: string; + identifier_start_string: string; + identifier_end_string: string; + replacement_string: string; + +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/BiDashHeader.ts b/frontend/angular-clarity-master/src/app/models/fnd/BiDashHeader.ts new file mode 100644 index 0000000..f1dc31b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/BiDashHeader.ts @@ -0,0 +1,13 @@ +import { BiDashLine } from './BiDashLine'; + +export class BiDashHeader{ + + + public header_id: number; + public dashboard_name: string; + public components: BiDashLine[]; + + + + +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/BiDashLine.ts b/frontend/angular-clarity-master/src/app/models/fnd/BiDashLine.ts new file mode 100644 index 0000000..2e49b8f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/BiDashLine.ts @@ -0,0 +1,17 @@ +export class BiDashLine{ + + + + public section_type: string; + public widgets1: string; + public widgets2: string; + public widgets3: string; + public widgets4: string; + public widgets5: string; + public widgets6: string; + + + + + +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/BiWidget.ts b/frontend/angular-clarity-master/src/app/models/fnd/BiWidget.ts new file mode 100644 index 0000000..52f1b7b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/BiWidget.ts @@ -0,0 +1,10 @@ +export class BiWidget { + public id: number; +public widget_name: string; +public widget_description: string; + public chart_type: string; + public sql_query:string; + public label:string; + public color_scheme:string; + +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/DynamicForm.ts b/frontend/angular-clarity-master/src/app/models/fnd/DynamicForm.ts new file mode 100644 index 0000000..6861694 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/DynamicForm.ts @@ -0,0 +1,37 @@ +//import { Audit } from "./Audit"; +import { Audit } from "../builder/Audit"; +export class DynamicForm extends Audit { + public id: number; + public form_id: number; + public form_version: number; + public comp1: string; + public comp2: string; + public comp3: string; + public comp4: string; + public comp5: string; + public comp6: string; + public comp7: string; + public comp8: string; + public comp9: string; + public comp10: string; + public comp11: string; + public comp12: string; + public comp13: string; + public comp14: string; + public comp15: string; + public comp16: string; + public comp17: string; + public comp18: string; + public comp19: string; + public comp20: string; + public comp21: string; + public comp22: string; + public comp23: string; + public comp24: string; + public comp25: string; + public comp_l26: string; + public comp_l27: string; + public comp_l28: string; + public comp_l29: string; + public comp_l30: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/ExtensionField.ts b/frontend/angular-clarity-master/src/app/models/fnd/ExtensionField.ts new file mode 100644 index 0000000..3becca0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/ExtensionField.ts @@ -0,0 +1,47 @@ +import { Audit } from "../builder/Audit"; + +export class ExtensionField extends Audit { + public id: number; + public field_name: string; + public mapping: string; + public data_type: string; + public form_code: string; + public type: string; + public isActive: boolean; + + /* public mandatory: string; + public hidden: string; + public readonly: string; + public dependent: string; + public dependent_on: string; + public dependent_sp: string; + public dependent_sp_param: string; + public validation_1: string; + public val_type: string; + public val_sp: string; + public val_sp_param: string; + public sequence: string; + public seq_name: string; + public seq_sp: string; + public seq_sp_param: string; + public default1: string; + public default_type: string; + public default_value: string; + public default_sp: string; + public default_sp_param: string; + public calculated_field: string; + public cal_sp: string; + public cal_sp_param: string; + public add_to_grid: string; + public attr1: string; + public attr2: string; + public attr3: string; + public drop_value: string; + public dropdown: string; + public sp_name: string; + public ext_dd_id: string; + public sp_name_forautocomplete: string; + public ext_dependent_id: string; + public radio: string; + public radio_option: string; */ +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/Mapping.ts b/frontend/angular-clarity-master/src/app/models/fnd/Mapping.ts new file mode 100644 index 0000000..385fdd6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/Mapping.ts @@ -0,0 +1,4 @@ +export interface Mapping { + label: string; + value: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/Rn_Forms_Component_Setup.ts b/frontend/angular-clarity-master/src/app/models/fnd/Rn_Forms_Component_Setup.ts new file mode 100644 index 0000000..41378c8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/Rn_Forms_Component_Setup.ts @@ -0,0 +1,12 @@ +import { Audit } from "../builder/Audit"; +export class Rn_Forms_Component_Setup extends Audit { + public component_id: number; + public label: string; + public type: string; + public mapping: string; + public mandatory: string; + public readonly: string; + public drop_values: string; + public sp: string; + +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/Rn_Forms_Setup.ts b/frontend/angular-clarity-master/src/app/models/fnd/Rn_Forms_Setup.ts new file mode 100644 index 0000000..872efee --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/Rn_Forms_Setup.ts @@ -0,0 +1,11 @@ +import { Rn_Forms_Component_Setup } from "./Rn_Forms_Component_Setup"; +import { Audit } from "../builder/Audit"; +export class Rn_Forms_Setup extends Audit { + public form_id: number; + public form_name: string; + public form_desc: string; + public related_to: string; + public page_event: string; + public button_caption: string; + public components: Rn_Forms_Component_Setup[]; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/RuleCopy.ts b/frontend/angular-clarity-master/src/app/models/fnd/RuleCopy.ts new file mode 100644 index 0000000..0b905a4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/RuleCopy.ts @@ -0,0 +1,20 @@ +export class RuleCopy { + public from_tech_stack: string; +public from_object_type: string; +public from_sub_object_type: string; +public to_tech_stack: string; +public to_object_type: string; +public to_sub_object_type: string; + +} + +export interface Rule { + tech_stack: string; + object_type: string; + sub_object_type: string; + version: string; + replacement_string: string; + keyword: string; + priority: number; + service: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/Studentadd.ts b/frontend/angular-clarity-master/src/app/models/fnd/Studentadd.ts new file mode 100644 index 0000000..25927d4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/Studentadd.ts @@ -0,0 +1,10 @@ + + +export class student { + public id: number; + public wf_id:number; + public current_json: string; + public status: string; + + +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/TableList.ts b/frontend/angular-clarity-master/src/app/models/fnd/TableList.ts new file mode 100644 index 0000000..8f66129 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/TableList.ts @@ -0,0 +1,4 @@ +export interface TableList { + // id: number; + table_name: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/ValidationError.ts b/frontend/angular-clarity-master/src/app/models/fnd/ValidationError.ts new file mode 100644 index 0000000..a72bfd6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/ValidationError.ts @@ -0,0 +1,4 @@ +export class ValidationError { + field: any; + message: any; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/apiregisteryline.ts b/frontend/angular-clarity-master/src/app/models/fnd/apiregisteryline.ts new file mode 100644 index 0000000..5db740a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/apiregisteryline.ts @@ -0,0 +1,10 @@ +export class ApiRegisteryLine { + public id: number; + public url: string; + public method: string; + public header_id: number; + + + + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/models/fnd/book.ts b/frontend/angular-clarity-master/src/app/models/fnd/book.ts new file mode 100644 index 0000000..3f9f0de --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/book.ts @@ -0,0 +1,10 @@ +export class book { + public id: number; + public booktype: string; + public bookname: string; + public price: number; + public writer: string; + public code:number; + + +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/department.ts b/frontend/angular-clarity-master/src/app/models/fnd/department.ts new file mode 100644 index 0000000..5da15cf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/department.ts @@ -0,0 +1,10 @@ +export class Department { + public id: number; + public department_code: string; + public description: string; + public active: string; + public created_by:string; + public created_on:string; + public updated_by:string; + public updated_on:string; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/health_checkup.ts b/frontend/angular-clarity-master/src/app/models/fnd/health_checkup.ts new file mode 100644 index 0000000..6cff663 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/health_checkup.ts @@ -0,0 +1,10 @@ +export class HealthCheckup { + public id: number; + public ip: string; + public port: number; + public serviceName: string; + public createProject: boolean; + public buildProject: boolean; + public createDeployment: boolean; + public deployApp: boolean; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/models/fnd/play.ts b/frontend/angular-clarity-master/src/app/models/fnd/play.ts new file mode 100644 index 0000000..3c5b927 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/play.ts @@ -0,0 +1,9 @@ +export class College { + public studentid: number; + public wf_instance_id:number; + public studentname: string; + public department: string; + public joiningDate: string; + public phone: number; + public emailId:string; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/table-setup.ts b/frontend/angular-clarity-master/src/app/models/fnd/table-setup.ts new file mode 100644 index 0000000..8f66129 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/table-setup.ts @@ -0,0 +1,4 @@ +export interface TableList { + // id: number; + table_name: string; +} diff --git a/frontend/angular-clarity-master/src/app/models/fnd/university.ts b/frontend/angular-clarity-master/src/app/models/fnd/university.ts new file mode 100644 index 0000000..16e9a12 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/models/fnd/university.ts @@ -0,0 +1,11 @@ +import {book} from '../../models/fnd/book'; + +export class university { + public id: number; + public name: string; + public email: string; + public subject: string; + public phone: number; + public books: book[]; + +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.css b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.css new file mode 100644 index 0000000..1d2e597 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.css @@ -0,0 +1,45 @@ +.clr-input { + color: #212529; + padding: 0.75rem 0.75rem; + margin-top: 10px; + margin-bottom: 10px; +} + +input[type=text], [type=password], [type=number], [type=email], [type=date], textarea { + width: 80%; + padding: 15px 15px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.eye { + position: absolute; +} + +#hide1 { + display: none; +} + +.container { + align-content: center; +} + +.center { + width: auto; + margin: 0 auto; +} + +.required-field, .error_mess { + color: red; +} + +select { + margin: 15px 0px; + width: 80%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +}/*# sourceMappingURL=about-work.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.css.map b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.css.map new file mode 100644 index 0000000..f40c4d1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["about-work.component.scss","about-work.component.css"],"names":[],"mappings":"AAAA;EACE,cAAA;EAGA,wBAAA;EACA,gBAAA;EACA,mBAAA;ACDF;;ADGA;EACE,UAAA;EACA,kBAAA;EACA,oCAAA;EAEA,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACDF;;ADGA;EACE,kBAAA;ACAF;;ADGA;EACE,aAAA;ACAF;;ADGA;EACE,qBAAA;ACAF;;ADGA;EACE,WAAA;EACA,cAAA;ACAF;;ADGA;EACE,UAAA;ACAF;;ADGA;EACE,gBAAA;EACA,UAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACAF","file":"about-work.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.html b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.html new file mode 100644 index 0000000..5faf200 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.html @@ -0,0 +1,261 @@ + + + + +
+

Welcome to cloudnsure!

+
Tell Us More About You
+
Tell Us About Your Work!
+ +
+
+
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
*Number must be 10 digit.
+
*Invalid mobile number
+
+
+
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
+
+
+
+ + + +
+
*This field is Required
+
*Password must be 6 characters or longer.
+
+
+
+
+ + +
+
*This field is Required
+
* Password and Confirm Password must be match.
+
+
+
+
+ +
+ +
+

Wrong account? Log in instead.

+
+
+
+ + +
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
+
+ + + + + + + +
+
+ + +
+
*This field is Required
+
+
+ + +
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
+
+
+
+ + +
+
*This field is Required
+
+
+ + + +
+
+ +
+ +
+

Wrong account? Log in instead.

+
+ + +
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.scss b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.scss new file mode 100644 index 0000000..a3a8aee --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.scss @@ -0,0 +1,122 @@ +// .clr-input { +// color: #212529; +// // border: 1px solid #ced4da; +// // border-radius: 0.25rem; +// padding: 0.75rem 0.75rem; +// margin-top: 10px; +// margin-bottom: 10px; +// } +// input[type=text],[type=password],[type=number],[type=email],[type=date],textarea { +// width: 80%; +// padding: 15px 15px; +// background-color:rgb(255, 255, 255); +// // margin: 8px 0; +// display: inline-block; +// border: 1px solid #ccc; +// border-radius: 4px; +// box-sizing: border-box; +// } +// .eye { +// position: absolute; +// } + +// #hide1 { +// display: none; +// } + +// .container { +// align-content: center; +// } + +// .center { +// width: auto; +// margin: 0 auto; +// } + +.required-field,.error_mess{ + color:indianred; + font-weight: bold; + + } + // select{ + // margin:15px 0px; + // width: 80%; + // padding: 5px 5px; + // border: 1px solid #ccc; + // border-radius: 4px; + // } + + + + + + + $background: #f5f6fa; + $text: #9c9c9c; + $input-bg-color: #fff; + $input-text-color: #a3a3a3; + $button-bg-color: #7f8ff4; + $button-text-color: #fff; + $google-button-bg-color: #7f8ff4; + $linkedin-button-bg-color: #4b76eb; + + + :root { + background: $background; + color: $text; + font: 1rem "PT Sans", sans-serif; + } + + //** helper + .display_msg { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + } + + .form { + &__field { + width: 360px; + padding: 7px 9px; + margin: 0 12px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + } + + .btn { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; + + &--primary { + background: $button-bg-color; + color: $button-text-color; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + width: 100%; + + &:hover { + background: darken($button-bg-color, 4%); + } + + &:active { + background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } + } + // form { + // margin-left: 8%; + // } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.spec.ts new file mode 100644 index 0000000..fcd9bd1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AboutWorkComponent } from './about-work.component'; + +describe('AboutWorkComponent', () => { + let component: AboutWorkComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AboutWorkComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AboutWorkComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.ts b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.ts new file mode 100644 index 0000000..953b3b6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/about-work/about-work.component.ts @@ -0,0 +1,301 @@ +import {Component, OnInit} from '@angular/core'; +import {AbstractControl, FormBuilder, FormControl, FormGroup, ValidationErrors, Validators} from '@angular/forms'; +import {ActivatedRoute, Router} from '@angular/router'; +import { UserProfileService } from 'src/app/services/admin/user-profile.service'; +import { UserRegistrationService } from 'src/app/services/admin/user-registration.service'; +import { environment } from 'src/environments/environment'; +import { CustomerService } from './customer.service'; +import { ToastrService } from 'ngx-toastr'; + +@Component({ + selector: 'app-about-work', + templateUrl: './about-work.component.html', + styleUrls: ['./about-work.component.scss'] +}) + + + +export class AboutWorkComponent implements OnInit { + + // LoginUrl = environment.portalurl; + public entryForm: FormGroup; + public custentryForm: FormGroup; // user + public customerentryForm: FormGroup; + aboutdata; + id: number; + checknumberId: number; + data1: boolean; + name:string; + email: string; + submitted = false; + custsubmitted = false; + constructor( + private router: Router, + private route: ActivatedRoute, + private userRegistration: UserRegistrationService, + private _fb: FormBuilder, + private userprofile: UserProfileService, + private customerservice: CustomerService, + private toastr: ToastrService + ) { + } + companyid = 1; + ngOnInit(): void { + this.route.queryParams.subscribe(params => { + this.email = params['email']; + console.log(this.email) + }); + this.id = this.route.snapshot.params['id']; + this.checknumberId = this.route.snapshot.params['checknumberId']; + this.name = this.userRegistration.getStoredName(); + console.log(this.id, this.checknumberId); + this.userRegistration.removeStoredName(); + + // this.data1 = this.route.snapshot.data['data1']; + // if (this.id >= 0) { + // this.onCheck(); + + // } + // else { + // this.router.navigate(['../about-work']); + // } + + + this.onCheck(); + // this.email = this.userRegistration.getStoredEmail(); + + this.custentryForm = this._fb.group({ + first_name: [null, [Validators.required]], + last_name:[null, [Validators.required]], + mob_no:[null,[Validators.required,Validators.pattern('^[0-9]{10}$')]], + email:[this.email], + usrGrpId:[41], + new_password: [null, [Validators.required,Validators.minLength(6),Validators.maxLength(40)]], + confirm_password: [null, [Validators.required]], + account_id:[this.companyid], + + date_of_birth:[null, [Validators.required]], + gender:[null,Validators.required] + + }, { + validator: ConfirmedValidator('new_password', 'confirm_password') + }); + + + this.entryForm = this._fb.group({ + companyName:[null, [Validators.required]], + pancard:[null,[Validators.required]], + workspace:[null,[Validators.required]], + email: [this.email,[Validators.required,Validators.email]], + gstNumber:[null,[Validators.required]], + mobile: [this.custentryForm.value.mob_no, [Validators.pattern('^[0-9]{10}$')]], + + country:[null,[Validators.required]], + state:[null,[Validators.required]], + city:[null], + street_address:[null], + street_address2:[null], + + }, { + }); + + this.customerentryForm = this._fb.group({ + first_name: [null], + last_name:[null], + date_of_birth:[null], + gender:[null], + companyId:[null], + time_zone:[null,], + gst_state:[null], + email:[null], + entity_name:[this.companyid], + + }); + } + + companyForm:boolean = false; + oncustSubmit(){ + console.log(this.custentryForm.value); + // this.custentryForm.value.entity_name = this.companyid; + if (this.custentryForm.invalid) { + this.custsubmitted = true; + return; + }else{ + // this.companyForm = true; + // this.oncustContinue(); + this.onContinue(); + } + + } + selectedFile; + oncustContinue() { + + + + console.log(this.custentryForm.value); + + this.customerservice.saveCustomer(this.custentryForm.value, this.selectedFile).subscribe((data => { + console.log(data); + console.log(data.id, "User id"); + console.log("Roles", data.role); + console.log(data.checknumberId, "checknumber"); + this.aboutdata = data; + if (data.role == "USER") { + this.router.navigate(["../login/"]); + // window.location.href = `${this.LoginUrl}/#/login`; + } else { + this.router.navigate(["../pricing/" + data.id]); + } + + })) + } + + + +userId; + +onSubmit(){ + this.entryForm.value.email = this.email + if (this.entryForm.invalid) { + this.submitted = true; + return; + }else{ + this.onContinue(); + } + +} + onContinue() { + + + // this.entryForm.value.mobile = this.custentryForm.value.mob_no; + console.log(this.custentryForm.value); + + // this.userprofile.addUserinSignUP(this.entryForm.value).subscribe(data => { + // console.log(data); + // this.companyid = data.account_id; + // console.log(this.companyid, "company id"); + // this.aboutdata = data; + // this.custentryForm.value.account_id = data?.account_id + // // this.custentryForm.value.new_password = + // console.log(this.custentryForm.value); + this.userprofile.adduserData(this.custentryForm.value).subscribe(cdata => { + console.log(cdata); + this.userId = cdata.userId; + + if (cdata) { + this.toastr.success("Registrated Successfully"); + this.router.navigate(["../login/"]); + } else { + this.router.navigate(["../login/"]); + } + // this.customerentryForm.get('companyId').setValue(this.companyid); + // this.customerentryForm.get('gst_state').setValue(this.entryForm.value.state); + // this.customerentryForm.get('entity_name').setValue(this.entryForm.value.companyName); + // this.customerentryForm.get('first_name').setValue(this.custentryForm.value.first_name); + // this.customerentryForm.get('last_name').setValue(this.custentryForm.value.last_name); + // this.customerentryForm.get('date_of_birth').setValue(this.custentryForm.value.date_of_birth); + // this.customerentryForm.get('gender').setValue(this.custentryForm.value.gender); + // this.customerentryForm.get('email').setValue(this.email); + + + // this.customerservice.saveCustomer(this.customerentryForm.value, this.selectedFile).subscribe(data => { + // console.log(data); + // console.log(data.id, "User id"); + // this.aboutdata = data; + // if (data.status >= 200 && data.status <= 299) { + // console.log(data?.body) + // this.router.navigate(["../pricing/" + this.companyid +"/" +this.userId]); + // } + // }) + },(error)=>{ + console.log(error); + this.toastr.error(error?.error.message); + }) + // }) + } + + + + + + + + + onCheck() { + + this.userprofile.getUser(this.id, this.checknumberId).subscribe((data => { + // console.log(data.userId, "User id"); + console.log("data", data.email); + console.log(data); + this.data1 = data; + this.email = data.email; + this.name=data.fullName; + (this.entryForm.controls['email']).setValue(data.email); + (this.entryForm.controls['name']).setValue(data.fullName); + console.log(this.name) + + })) + + + } + + + onCountryChange(event) { + console.log(event.dialCode); + console.log(event.name); + console.log(event.iso2); + } + + back() { + this.router.navigate(["../../all"], {relativeTo: this.route}); + } + + + newpHide: boolean = true; + newIcon: string = "eye"; + newShapeChanger() { + this.newpHide = !this.newpHide; + if(this.newpHide){ + this.newIcon = 'eye' + } else { + this.newIcon = 'eye-hide' + } + } + + + cnewpHide: boolean = true; + cnewIcon: string = "eye"; + cnewShapeChanger() { + this.cnewpHide = !this.cnewpHide; + if(this.cnewpHide){ + this.cnewIcon = 'eye' + } else { + this.cnewIcon = 'eye-hide' + } + } + +} +// export function passwordMatchValidator(control: AbstractControl): ValidationErrors | null { +// const password = control.get('password'); +// const confirmPassword = control.get('confirmPassword'); + +// if (password.value !== confirmPassword.value) { +// return { passwordMismatch: true }; +// } + +// return null; +// } +export function ConfirmedValidator(controlName: string, matchingControlName: string){ + return (formGroup: FormGroup) => { + const control = formGroup.controls[controlName]; + const matchingControl = formGroup.controls[matchingControlName]; + if (matchingControl.errors && !matchingControl.errors.confirmedValidator) { + return; + } + if (control.value !== matchingControl.value) { + matchingControl.setErrors({ confirmedValidator: true }); + } else { + matchingControl.setErrors(null); + } + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/about-work/customer.service.ts b/frontend/angular-clarity-master/src/app/modules/login/about-work/customer.service.ts new file mode 100644 index 0000000..a0db265 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/about-work/customer.service.ts @@ -0,0 +1,152 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from 'src/app/services/api/api-request.service'; + +@Injectable({ + providedIn: 'root' +}) +export class CustomerService { + + constructor(private apiRequest: ApiRequestService) { } + + saveCustomer(data: any, file?: any): Observable { + const url = `token/Customer_master/Customer_master`; + const formData = new FormData(); + formData.append('body', JSON.stringify(data)); + formData.append('file', file); + + return this.apiRequest.postFormData(url, formData); + } + + updateCustomer(data: any, file: any,id: number): Observable { + const url = `token/Customer_master/Customer_master/${id}`; + + const formData = new FormData(); + formData.append('body', JSON.stringify(data)); + formData.append('file', file); + + return this.apiRequest.postFormData(url, formData); + } + + getAllCustomers(): Observable { + const url = `token/Customer_master/Customer_master`; + return this.apiRequest.get(url); + } + + getCustomerById(id: number): Observable { + const url = `token/Customer_master/Customer_master/${id}`; + return this.apiRequest.get(url); + } + + deleteCustomerById(id: number): Observable { + const url = `token/Customer_master/Customer_master/${id}`; + return this.apiRequest.delete(url); + } + + + + + ////////site + + // saveCustomersite(data: any, file: any): Observable { + // const url = `Sites/Sites`; + // const formData = new FormData(); + // formData.append('body', JSON.stringify(data)); + // formData.append('file', file); + + // return this.apiRequest.postFormData(url, formData); + // } + saveCustomersite(data: any): Observable { + const url = `Sites/Sites`; + return this.apiRequest.postFormData(url, data); + } + + // updateCustomersite(data: any, file: any,id: number): Observable { + // const url = `Sites/Sites/${id}`; + + // const formData = new FormData(); + // formData.append('body', JSON.stringify(data)); + // formData.append('file', file); + + // return this.apiRequest.postFormData(url, formData); + // } + + updateCustomersite(data: any,id: number): Observable { + const url = `Sites/Sites/${id}`; + return this.apiRequest.put(url, data); + } + + getAllCustomerssite(): Observable { + const url = `Sites/Sites`; + return this.apiRequest.get(url); + } + + getCustomersiteById(id: number): Observable { + const url = `Sites/Sites/${id}`; + return this.apiRequest.get(url); + } + + deleteCustomersiteById(id: number): Observable { + const url = `Sites/Sites/${id}`; + return this.apiRequest.delete(url); + } + + + getsiteBycustId(id: number): Observable { + const url = `Sites/getSitesByCustomer/${id}`; + return this.apiRequest.get(url); + } + + + + ////// custom package + + public savecustompkgeData(data: any): Observable { + return this.apiRequest.post(`Billing/CustomPackage/CustomPackage`, data); + } + + public getcustompkgDetails(): Observable { + return this.apiRequest.get(`Billing/CustomPackage/CustomPackage`); + } + + public getcustompkgDetailsById(id: number): Observable { + return this.apiRequest.get(`Billing/CustomPackage/CustomPackage/${id}`); + } + + public deletecustompkgById(id: number): Observable { + return this.apiRequest.delete(`Billing/CustomPackage/CustomPackage/${id}`); + } + + public updatecustompkgData(data: any, id: number): Observable { + return this.apiRequest.put(`Billing/CustomPackage/CustomPackage/${id}`, data); + } + + + ///biiling total + public billingTotal(invoiceId: number, creditNoteId:number,paymentId): Observable { + return this.apiRequest.get(`Billing/Payments/alltotall/${invoiceId}/${creditNoteId}/${paymentId}`); + } + + public getdatabycustID(customerId: any): Observable { + return this.apiRequest.get(`token/Customer_master/getReceiptApplication/${customerId}`); + } + + + ////// list of items + //generate + getServicesBycustId(customerId: any): Observable { + return this.apiRequest.get(`token/Customer_master/getAllservices/${customerId}`); + } + + //generate 2 + getServices2BycustId(customerId: any): Observable { + return this.apiRequest.get(`token/Customer_master/getAllservicesWithDisc/${customerId}`); + } + + //discount and charges + //generate + getdiscountchargesBycustId(customerId: any): Observable { + return this.apiRequest.get(`token/Customer_master/getAllservicesWithDiscOrderlevel/${customerId}`); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.html b/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.html new file mode 100644 index 0000000..b5e25a4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.html @@ -0,0 +1,137 @@ + + +
+ + +
+ +
+ cloudnSure + +
+
+ + + + + + + + +
+
+

Welcome to cloudnsure!

+
You're signing up as {{email}} +
+
+
+
+ +
+
First Name is required
+
+
+
+ +
+
Last Name is required
+
+
+
+ +
+
Mobile Number is required
+
Mobile Number is 10 numbers
+
+
+
+ + +
+
password is required
+
Password must be Minimum 6 Characters
+
+
+
+ + +
+
Password is required.
+
Password and Confirm Password must be match.
+
+ + +
+
+

User Info Is Added Please Login

+

Wrong account? Log in instead.

+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.scss b/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.scss new file mode 100644 index 0000000..4408425 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.scss @@ -0,0 +1,86 @@ +//@import '../../../../../styles1.scss'; + + +//** variables +$background: #f5f6fa; +$text: #9c9c9c; +$input-bg-color: #fff; +$input-text-color: #a3a3a3; +$button-bg-color: #7f8ff4; +$button-text-color: #fff; +$google-button-bg-color: #7f8ff4; +$linkedin-button-bg-color: #4b76eb; + +//** root +:root { + background: $background; + color: $text; + font: 1rem "PT Sans", sans-serif; +} + +//** helper +.display_msg { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.form { + /* margin-left: auto; + margin-right: auto; */ + &__field { + // width: 360px; + // //background: #fff; + // color: $input-text-color; + // font: inherit; + // //box-shadow: 0 6px 10px 0 rgba(0, 0, 0 , .1); + // border: 1 solid rgb(235, 230, 230); + // background-color:rgb(255, 255, 255); + // display: inline-block; + // border-radius: 4px; + // box-sizing: border-box; + // //outline: 0; + // padding: 6px 9px; + width: 360px; + padding: 7px 9px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } +} + +.btn { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; + + &--primary { + background: $button-bg-color; + color: $button-text-color; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + width: 100%; + + &:hover { + background: darken($button-bg-color, 4%); + } + + &:active { + background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } +} +form { + margin-left: 8%; +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.spec.ts new file mode 100644 index 0000000..562261f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddguestComponent } from './addguest.component'; + +describe('AddguestComponent', () => { + let component: AddguestComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AddguestComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AddguestComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.ts b/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.ts new file mode 100644 index 0000000..4a01c87 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/addguest/addguest.component.ts @@ -0,0 +1,68 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; +import { MyworkspaceService } from 'src/app/services/admin/myworkspace.service'; +@Component({ + selector: 'app-addguest', + templateUrl: './addguest.component.html', + styleUrls: ['./addguest.component.scss'] +}) +export class AddguestComponent implements OnInit { + + public form: FormGroup; + submitted = false; + passchange; + newpHide: boolean = true; + newIcon: string = "eye"; + newShapeChanger() { + this.newpHide = !this.newpHide; + if(this.newpHide){ + this.newIcon = 'eye' + } else { + this.newIcon = 'eye-hide' + } + } + cpHide: boolean = true; + conIcon: string = "eye"; + comfShapeChanger() { + this.cpHide = !this.cpHide; + if(this.cpHide){ + this.conIcon = 'eye' + } else { + this.conIcon = 'eye-hide' + } + } + get f() { return this.form.controls; } + email: string; + token; + constructor(private _fb: FormBuilder, + private route: ActivatedRoute, + private mywork:MyworkspaceService) { } + + ngOnInit(): void { + this.email = this.mywork.getStoredEmail(); + console.log(this.email) + this.token = this.route.snapshot.params["id"]; + console.log("token is ", this.token); + //form validation + this.form = this._fb.group( + { + first_name: ['', Validators.required], + last_name: ['', Validators.required], + mob_no: ['', [Validators.required,Validators.minLength(10)]], + password: ['',[ Validators.required, Validators.minLength(6), Validators.maxLength(40)]], + confirm_password: ['', Validators.required], + + }, ); + } + onsubmit(){ +this.mywork.addguestdetails(this.form.value,this.token).subscribe((data)=>{ + console.log(data); + this.passchange=data; + console.log('success ', data); + },(err) => { + console.log('failure ', err); +}) + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.css b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.css new file mode 100644 index 0000000..0100f0b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.css @@ -0,0 +1,95 @@ +.header-6 { + background-color: #0072a3; +} + +:root { + background: #f5f6fa; + color: #9c9c9c; + font: 1rem "PT Sans", sans-serif; +} + +html, +body, +.container { + height: 100%; +} + +a { + color: inherit; +} +a:hover { + color: #7f8ff4; +} + +.email_check { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.uppercase { + text-transform: uppercase; +} + +.new { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; +} +.new--newprimary { + background: #7f8ff4; + color: #fff; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1); + border-radius: 2px; + width: 100%; +} +.new--newprimary:hover { + background: #6c7ff2; +} +.new--newprimary:active { + background: #7f8ff4; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, 0.2); +} +.new--primary1 { + background: #4CAF50; + color: #fff; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1); + border-radius: 2px; + width: 100%; +} +.new--primary1:hover { + background: #6c7ff2; +} +.new--primary1:active { + background: #7f8ff4; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, 0.2); +} + +/* &--inside { + margin-left: -96px; +} */ +.form { + /* margin-left: auto; + margin-right: auto; */ +} +.form__field { + width: 360px; + background: #fff; + color: #626161; + font: inherit; + box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.1); + border: 0; + outline: 0; + padding: 10px 18px; +} + +.form__field { + border: 2px solid #7f8ff4; +}/*# sourceMappingURL=emailverification.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.css.map b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.css.map new file mode 100644 index 0000000..c07827b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["emailverification.component.scss","emailverification.component.css"],"names":[],"mappings":"AAAA;EACE,yBAAA;ACCF;;ADUA;EACC,mBATY;EAUZ,cATM;EAUN,gCAAA;ACPD;;ADUA;;;EAGC,YAAA;ACPD;;ADUA;EACC,cAAA;ACPD;ADSC;EACC,cApBgB;ACalB;;ADYA;EACC,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,uBAAA;ACTD;;ADYA;EACC,yBAAA;ACTD;;ADaA;EACC,qBAAA;EACA,uBAAA;EACA,cAAA;EACA,aAAA;EACA,SAAA;EACA,UAAA;EACA,UAAA;EACA,6BAAA;EACA,eAAA;ACVD;ADYC;EACC,mBAjDgB;EAkDhB,WAjDkB;EAkDlB,2CAAA;EACA,kBAAA;EAGA,WAAA;ACZF;ADeE;EACC,mBAAA;ACbH;ADgBE;EACC,mBA/De;EAgEf,iDAAA;ACdH;ADiBC;EACC,mBAAA;EACA,WApEkB;EAqElB,2CAAA;EACA,kBAAA;EAGA,WAAA;ACjBF;ADoBE;EACC,mBAAA;AClBH;ADqBE;EACC,mBAlFe;EAmFf,iDAAA;ACnBH;;ADwBC;;GAAA;AAMD;EACC;uBAAA;ACvBD;ADyBC;EACC,YAAA;EAEA,gBAAA;EACA,cAtGiB;EAuGjB,aAAA;EACA,2CAAA;EACA,SAAA;EACA,UAAA;EACA,kBAAA;ACxBF;;AD2BA;EACE,yBAAA;ACxBF","file":"emailverification.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.html b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.html new file mode 100644 index 0000000..b490534 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.html @@ -0,0 +1,123 @@ + + + +
+
+ + +
+ +
+ {{ loginEnvironment.loginHeading2 | sanitize}} + +
+
+
+ +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.scss b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.scss new file mode 100644 index 0000000..acf07f3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.scss @@ -0,0 +1,153 @@ +.header-6 { + background-color: #0072a3; +} + +.recaptcha-container { + display: flex; + flex-direction: column; + align-items: center; + margin-top: 10px; +} + +.recaptcha-box { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 5px; +} + +.recaptcha-input { + width: 100%; + max-width: 300px; + padding: 8px; + text-align: center; + border: 1px solid #ccc; + border-radius: 4px; +} + +.error_mess { + color: red; + font-size: 12px; + margin-top: 5px; +} + +//** variables +$background: #f5f6fa; +$text: #9c9c9c; +$input-bg-color: #fff; +$input-text-color: #626161; +$button-bg-color: #7f8ff4; +$button-text-color: #fff; + +//** root +:root { + background: $background; + color: $text; + font: 1rem "PT Sans", sans-serif; +} + +html, +body, +.container { + height: 100%; +} + +a { + color: inherit; + + &:hover { + color: $button-bg-color; + } +} + +//** helper +.email_check { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.uppercase { + text-transform: uppercase; +} + +//** button +.new { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; + + &--newprimary { + background: $button-bg-color; + color: $button-text-color; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + //padding: 12px 36px; + //padding: 7px 158px; + width: 100%; + + + &:hover { + background: darken($button-bg-color, 4%); + } + + &:active { + background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } + + &--primary1 { + background: #4CAF50; + color: $button-text-color; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + //padding: 12px 36px; + //padding: 7px 158px; + width: 100%; + + + &:hover { + background: darken($button-bg-color, 4%); + } + + &:active { + background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } +} + +/* &--inside { + margin-left: -96px; + } */ + + +//** form +.form { + + /* margin-left: auto; + margin-right: auto; */ + &__field { + width: 360px; + //width: 450px; + background: #fff; + color: $input-text-color; + font: inherit; + box-shadow: 0 6px 10px 0 rgba(0, 0, 0, .1); + border: 0; + outline: 0; + padding: 10px 18px; + } +} + +.form__field { + border: 2px solid #7f8ff4; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.spec.ts new file mode 100644 index 0000000..220c3b5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EmailverificationComponent } from './emailverification.component'; + +describe('EmailverificationComponent', () => { + let component: EmailverificationComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ EmailverificationComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(EmailverificationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.ts b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.ts new file mode 100644 index 0000000..50a3b58 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/emailverification/emailverification.component.ts @@ -0,0 +1,236 @@ +import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { HttpClient, HttpErrorResponse } from "@angular/common/http"; + +import { AbstractControl, FormBuilder, FormGroup, ValidationErrors, Validators } from "@angular/forms"; +import { ActivatedRoute, Router } from "@angular/router"; + + +import { UserRegistrationService } from 'src/app/services/admin/user-registration.service'; +import { environment } from 'src/environments/environment'; +import { ToastrService } from 'ngx-toastr'; +import { LoginEnvironment } from '../login-page/login_environment'; + +export interface EmailRequest { + email: string; +} +@Component({ + selector: 'app-emailverification', + templateUrl: './emailverification.component.html', + styleUrls: ['./emailverification.component.scss'] +}) +export class EmailverificationComponent implements OnInit { + + loginEnvironment = LoginEnvironment; + + + + // baseUrl= environment.portalurl; + submitted = false; + conditions = { + condition1: true, + condition2: true, + condition3: true, + } + + siteKey = environment.captchaSiteKey; + // siteKey: string = "6Le7ayYpAAAAAL76n79XlVJCg1jbXZGbnzGNJ1rt"; + constructor(private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private userRegistrationService: UserRegistrationService, + private http: HttpClient, + private toastr: ToastrService) { + } + + ngOnInit(): void { + this.generatefieldname(); + this.userRegistrationService.removeSignedUpUserInfo(); + this.userRegistrationService.removeStoredEmail(); + this.emailCheckForm = this._fb.group({ + email: [null, [Validators.email, Validators.required]], + // recaptcha: ['', Validators.required], + recaptcha: [null, [Validators.required, this.checkfieldname.bind(this)]], + first_name: [null], + last_name: [null], + mob_no: [null], + account_id: [null], + usrGrpId: [null], + new_password: [null], + confirm_password: [null], + accesstype: [null], + }); + } + + model: any = {}; + EmailRequest: EmailRequest; + emailErrMsg: string = "" + + fieldnameCode = ''; + generatefieldname(): void { + const possibleCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const codeLength = 6; // Change to desired length + + let fieldname = ''; + for (let i = 0; i < codeLength; i++) { + const randomIndex = Math.floor(Math.random() * possibleCharacters.length); + fieldname += possibleCharacters.charAt(randomIndex); + } + this.fieldnameCode = fieldname; + } + + checkfieldname(control: AbstractControl): ValidationErrors | null { + if (control.value !== this.fieldnameCode) { + return { fieldnameMismatch: true }; + } + return null; + } + + fieldnameMismatch = false; + + // checkfieldnameEdit(): void { + // if (this.rowSelected.recaptcha !== this.fieldnameCode) { + // this.fieldnameMismatch = true; + // } else { this.fieldnameMismatch = false; } + // } + emailExistCheck() { + console.log('input email: ', this.model.email); + this.userRegistrationService.emailCheck(this.model.email) + .subscribe((res) => { + console.log('email check Res : ', res); + }, (err) => { + console.log(err); + }); + } + + emailCheckForm: FormGroup; + + get f() { + return this.emailCheckForm.controls; + } + + // onSubmit() { + // console.log('this.emailCheckForm.value : ', this.emailCheckForm.value); + // this.userRegistrationService.emailCheck(this.emailCheckForm.value) + // .subscribe((res) => { + // console.log('success: ', res); + // let email: string = res.message; + // console.log(email); + // this.userRegistrationService.storeEmail(email); + // this.router.navigate(["/selfregistration"]); + // }, (err: HttpErrorResponse) => { + // console.log(err); + // console.log(err.error.message); + // if (err.status === 409) { + // this.emailErrMsg = 'Email Already Exists'; + // } else { + // this.emailErrMsg = 'Server error'; + // } + // }); + // } + verifyButton = false; + handleSuccess(e) { + console.log("ReCaptcha", e); + console.log(this.emailCheckForm.controls); + const data: any = this.emailCheckForm.controls; + if (data.recaptcha.status == "VALID") { + this.verifyButton = true; + } + } + + result: any; + otpfromuser: string = ''; + otpshow = false; + onSubmit() { + if (this.emailCheckForm.invalid) { + this.submitted = true; + + console.log(`invalid form..`); + + Object.keys(this.emailCheckForm.controls).forEach(field => { + const control = this.emailCheckForm.get(field); + if (control && control.invalid) { + console.log(`Error in field: ${field}`, control.errors); + } + } + ); + return; + } + + let email = this.emailCheckForm.value.email; + console.log(this.emailCheckForm.value); + delete this.emailCheckForm.value.recaptcha + this.userRegistrationService.sendEmail(this.emailCheckForm.value).subscribe((res) => { + // this.userService.storeEmail(email); + // this.router.navigate(["/verify-account"]) + console.log(res); + this.emailErrMsg = ''; + + if (res) { + this.otpshow = true; + } + }, (err: HttpErrorResponse) => { + console.log(err) + if (err.status >= 400 && err.status <= 499) { + this.emailErrMsg = 'Email Already Exists or Enter Correct Email'; + } else { + this.emailErrMsg = 'Server error'; + } + }) + } + + + sendOTP(): void { + this.userRegistrationService.sendOTP(this.emailCheckForm.value.email).subscribe( + (response) => { + const email = this.emailCheckForm.value.email + console.log(`"${email}", please check and enter OTP from your email`, response); + // this.toastr.success(`"${email}", please check and enter OTP from your email`) + // Handle the response as needed + this.otpfromuser = '' + this.toastr.success(response?.msg.toString()); + }, + (error) => { + console.error('Failed to send OTP:', error); + // Handle errors + if (error.status >= 400 && error.status <= 499) { + this.toastr.error(error?.message.toString()); + } else if (error.status >= 500 && error.status <= 599) { + this.toastr.error("server error"); + } + } + ); + } + emailotpMsg: string = ""; + verifyOTP(): void { + this.userRegistrationService.verifyOTP(this.emailCheckForm.value.email, this.otpfromuser).subscribe( + (response) => { + console.log('OTP verification result:', response); + // Handle the verification result as needed + this.toastr.success(response?.msg.toString()); + setTimeout(() => { + this.router.navigate(["../about-work"], { relativeTo: this.route, queryParams: { email: this.emailCheckForm.value.email } }); + }, 500); + }, + (error) => { + console.error('OTP verification failed:', error); + // Handle errors + if (error.status >= 400 && error.status <= 499) { + // this.toastr.error(error?.error?.msg.toString()); + this.emailotpMsg = error?.error?.msg; + } else if (error.status >= 500 && error.status <= 599) { + this.emailotpMsg = 'Server error'; + } + } + ); + } + + + onSignUp() { + this.router.navigate(["signup"]); + } + + goToLogin() { + // window.location.href = `${this.baseUrl}/#/login`; + this.router.navigate(["login"]) + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.html b/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.html new file mode 100644 index 0000000..c7dbdff --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.html @@ -0,0 +1,38 @@ + + +
+ + +
+ +
+ cloudnSure + +
+
+ +
+ + +
+
+ + + + diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.scss b/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.scss new file mode 100644 index 0000000..546c22b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.scss @@ -0,0 +1,75 @@ +.email_check { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +.form { + /* margin-left: auto; + margin-right: auto; */ + &__field { + width: 370px; + //width: 450px; + background: #fff; + color: #a3a3a3; + font: inherit; + box-shadow: 0 6px 10px 0 rgba(0, 0, 0 , .1); + border: 0; + outline: 0; + padding: 10px 18px; + } +} +.form__field{ + border: 2px solid #7f8ff4 ; +} + +.btn { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; + + &--primary { + background: #7f8ff4; + color: #fff; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + //padding: 12px 36px; + //padding: 7px 158px; + width: 100%; + + + &:hover { + background: darken(#7f8ff4, 4%); + } + + &:active { + //background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } + &--primary1{ + background: #4CAF50; + color: #fff; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + //padding: 12px 36px; + //padding: 7px 158px; + width: 100%; + + + &:hover { + background: darken(#7f8ff4, 4%); + } + + &:active { + background: #7f8ff4; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.spec.ts new file mode 100644 index 0000000..5b02d71 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ForgotpasswordComponent } from './forgotpassword.component'; + +describe('ForgotpasswordComponent', () => { + let component: ForgotpasswordComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ForgotpasswordComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ForgotpasswordComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.ts b/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.ts new file mode 100644 index 0000000..5888101 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotpassword/forgotpassword.component.ts @@ -0,0 +1,67 @@ +import { HttpErrorResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import {ForgotpassService} from '../../../services/api/forgotpass.service'; +@Component({ + selector: 'app-forgotpassword', + templateUrl: './forgotpassword.component.html', + styleUrls: ['./forgotpassword.component.scss'] +}) +export class ForgotpasswordComponent implements OnInit { + public emailCheckForm: FormGroup; + emailErrMsg: string = "" +emailsend; + constructor(private _fb: FormBuilder, + private router: Router, + private route:ActivatedRoute, + private toastr:ToastrService, + private forgotpassservice:ForgotpassService) { } + + ngOnInit(): void { + this.emailCheckForm = this._fb.group({ + email: ['', Validators.email] + }); + } + onsubmit(){ + let email = this.emailCheckForm.value.email; + console.log(email); + this.forgotpassservice.sendemail(email).subscribe((data)=>{ + this.forgotpassservice.storeEmail(email); + console.log(data); + + // if(data=200){ + // this.toastr.success('Email Send successfully'); + // } + }, + (err: HttpErrorResponse) => { + console.log(err) + if (err.status === 200) { + this.emailsend=err.status; + //this.emailErrMsg = 'Email send please check mail'; + } + + } + ); + this.emailCheckForm.reset(); + } + onSubmit() { + let email = this.emailCheckForm.value.email; + console.log(email); + this.forgotpassservice.sendemail(email).subscribe((res) => { + this.forgotpassservice.storeEmail(email); + //this.router.navigate(["/varify-account"]) + }, (err: HttpErrorResponse) => { + console.log(err) + if (err.status === 409) { + this.emailErrMsg = 'Email Already Exists'; + } else { + this.emailErrMsg = 'Server error'; + } + }) + } + gotoreset(){ + this.router.navigate(["../forgotresetpassword"], { relativeTo: this.route }); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.html b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.html new file mode 100644 index 0000000..7f51910 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.html @@ -0,0 +1,50 @@ + + +
+ + +
+ +
+ cloudnSure + +
+
+ +
+
+

Please Reset Your Password

+

you're signed in as {{ email }}

+
+ +
+ +
+ + +
+
password is required
+
Password must be Minimum 3 Characters
+
+
+
+ + +
+
Password is required.
+
Password and Confirm Password must be match.
+
+
+ +
+
+

Email Is Reset Please Login

+

Wrong account? Log in instead.

+
+
diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.scss b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.scss new file mode 100644 index 0000000..3ee7d64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.scss @@ -0,0 +1,83 @@ +//@import '../../../../../styles1.scss'; + + +//** variables +$background: #f5f6fa; +$text: #9c9c9c; +$input-bg-color: #fff; +$input-text-color: #a3a3a3; +$button-bg-color: #7f8ff4; +$button-text-color: #fff; +$google-button-bg-color: #7f8ff4; +$linkedin-button-bg-color: #4b76eb; + +//** root +:root { + background: $background; + color: $text; + font: 1rem "PT Sans", sans-serif; +} + +//** helper +.display_msg { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.form { + /* margin-left: auto; + margin-right: auto; */ + &__field { + // width: 360px; + // //background: #fff; + // color: $input-text-color; + // font: inherit; + // //box-shadow: 0 6px 10px 0 rgba(0, 0, 0 , .1); + // border: 1 solid rgb(235, 230, 230); + // background-color:rgb(255, 255, 255); + // display: inline-block; + // border-radius: 4px; + // box-sizing: border-box; + // //outline: 0; + // padding: 6px 9px; + width: 360px; + padding: 9px 11px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } +} + +.btn { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; + + &--primary { + background: $button-bg-color; + color: $button-text-color; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + width: 100%; + + &:hover { + background: darken($button-bg-color, 4%); + } + + &:active { + background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.spec.ts new file mode 100644 index 0000000..d6988e6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ForgotresetpasswordComponent } from './forgotresetpassword.component'; + +describe('ForgotresetpasswordComponent', () => { + let component: ForgotresetpasswordComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ForgotresetpasswordComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ForgotresetpasswordComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.ts b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.ts new file mode 100644 index 0000000..c61c0a8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword/forgotresetpassword.component.ts @@ -0,0 +1,103 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import {ForgotpassService} from '../../../services/api/forgotpass.service'; +@Component({ + selector: 'app-forgotresetpassword', + templateUrl: './forgotresetpassword.component.html', + styleUrls: ['./forgotresetpassword.component.scss'] +}) +export class ForgotresetpasswordComponent implements OnInit { + emailErrMsg: string = "" + oldpHide: boolean = true; + oldIcon: string = "eye"; + passchange; + + oldShapeChanger() { + this.oldpHide = !this.oldpHide; + if(this.oldpHide){ + this.oldIcon = 'eye' + } else { + this.oldIcon = 'eye-hide' + } + } + newpHide: boolean = true; + newIcon: string = "eye"; + newShapeChanger() { + this.newpHide = !this.newpHide; + if(this.newpHide){ + this.newIcon = 'eye' + } else { + this.newIcon = 'eye-hide' + } + } + cpHide: boolean = true; + conIcon: string = "eye"; + comfShapeChanger() { + this.cpHide = !this.cpHide; + if(this.cpHide){ + this.conIcon = 'eye' + } else { + this.conIcon = 'eye-hide' + } + } + email: string; + resetPasswordForm: FormGroup; + token; + constructor( private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private forgotpassservice:ForgotpassService) { } + + ngOnInit(): void { + this.email = this.forgotpassservice.getStoredEmail(); + console.log(this.email) + //token + this.token = this.route.snapshot.params["id"]; + console.log("token is ", this.token); + this.resetPasswordForm = this._fb.group({ + email:this.email, + newPassword: ['', [Validators.required, Validators.minLength(3)]], + confirmPassword: ['', [Validators.required]] + }, { + validator: ConfirmedValidator('newPassword', 'confirmPassword') + }); + } + + get f() { return this.resetPasswordForm.controls; } + + submitted = false; + onSubmit() { + console.log('this.resetPasswordForm.value : ', this.resetPasswordForm.value); + this.submitted = true; + if(this.resetPasswordForm.invalid){ + return; + } + this.resetPassword(); + } + + resetPassword() { + this.forgotpassservice.resetpass(this.resetPasswordForm.value,this.token) + .subscribe((res) => { + this.passchange=res; + console.log('success ', res); + },(err) => { + console.log('failure ', err); + }); + this.resetPasswordForm.reset(); + } +} +export function ConfirmedValidator(controlName: string, matchingControlName: string){ + return (formGroup: FormGroup) => { + const control = formGroup.controls[controlName]; + const matchingControl = formGroup.controls[matchingControlName]; + if (matchingControl.errors && !matchingControl.errors.confirmedValidator) { + return; + } + if (control.value !== matchingControl.value) { + matchingControl.setErrors({ confirmedValidator: true }); + } else { + matchingControl.setErrors(null); + } + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.html b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.html new file mode 100644 index 0000000..86869d4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.html @@ -0,0 +1,142 @@ + + +
+ + +
+ +
+ cloudnSure + +
+
+ + + + + + + + +
+
+

Welcome to cloudnsure!

+
You're signing up as {{email}}
+
+
+
+ +
+
First Name is required
+
+
+
+ +
+
Last Name is required
+
+
+
+ +
+
Mobile Number is required
+
Mobile Number is 10 numbers
+
+
+
+ + +
+
password is required
+
Password must be Minimum 6 Characters
+
+
+
+ + +
+
Password is required.
+
Password and Confirm Password must be match.
+
+ + +
+
+

User Info Is Added Please Login

+

Wrong account? Log in instead.

+
+
+ + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.scss b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.scss new file mode 100644 index 0000000..4408425 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.scss @@ -0,0 +1,86 @@ +//@import '../../../../../styles1.scss'; + + +//** variables +$background: #f5f6fa; +$text: #9c9c9c; +$input-bg-color: #fff; +$input-text-color: #a3a3a3; +$button-bg-color: #7f8ff4; +$button-text-color: #fff; +$google-button-bg-color: #7f8ff4; +$linkedin-button-bg-color: #4b76eb; + +//** root +:root { + background: $background; + color: $text; + font: 1rem "PT Sans", sans-serif; +} + +//** helper +.display_msg { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.form { + /* margin-left: auto; + margin-right: auto; */ + &__field { + // width: 360px; + // //background: #fff; + // color: $input-text-color; + // font: inherit; + // //box-shadow: 0 6px 10px 0 rgba(0, 0, 0 , .1); + // border: 1 solid rgb(235, 230, 230); + // background-color:rgb(255, 255, 255); + // display: inline-block; + // border-radius: 4px; + // box-sizing: border-box; + // //outline: 0; + // padding: 6px 9px; + width: 360px; + padding: 7px 9px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } +} + +.btn { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; + + &--primary { + background: $button-bg-color; + color: $button-text-color; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + width: 100%; + + &:hover { + background: darken($button-bg-color, 4%); + } + + &:active { + background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } +} +form { + margin-left: 8%; +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.spec.ts new file mode 100644 index 0000000..04d1708 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Forgotresetpassword1Component } from './forgotresetpassword1.component'; + +describe('Forgotresetpassword1Component', () => { + let component: Forgotresetpassword1Component; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ Forgotresetpassword1Component ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(Forgotresetpassword1Component); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.ts b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.ts new file mode 100644 index 0000000..66b459e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/forgotresetpassword1/forgotresetpassword1.component.ts @@ -0,0 +1,71 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { MyworkspaceService } from 'src/app/services/admin/myworkspace.service'; + +@Component({ + selector: 'app-forgotresetpassword1', + templateUrl: './forgotresetpassword1.component.html', + styleUrls: ['./forgotresetpassword1.component.scss'] +}) +export class Forgotresetpassword1Component implements OnInit { + public form: FormGroup; + submitted = false; + passchange; + newpHide: boolean = true; + newIcon: string = "eye"; + newShapeChanger() { + this.newpHide = !this.newpHide; + if (this.newpHide) { + this.newIcon = 'eye' + } else { + this.newIcon = 'eye-hide' + } + } + cpHide: boolean = true; + conIcon: string = "eye"; + comfShapeChanger() { + this.cpHide = !this.cpHide; + if (this.cpHide) { + this.conIcon = 'eye' + } else { + this.conIcon = 'eye-hide' + } + } + get f() { return this.form.controls; } + email: string; + token; + constructor(private _fb: FormBuilder, + private route: ActivatedRoute, + private mywork: MyworkspaceService, + private toastr: ToastrService,) { } + + ngOnInit(): void { + this.email = this.mywork.getStoredEmail(); + console.log(this.email) + this.token = this.route.snapshot.params["id"]; + console.log("token is ", this.token); + //form validation + this.form = this._fb.group( + { + first_name: ['', Validators.required], + last_name: ['', Validators.required], + mob_no: ['', [Validators.required, Validators.minLength(10)]], + password: ['', [Validators.required, Validators.minLength(6), Validators.maxLength(40)]], + confirm_password: ['', Validators.required], + + },); + } + onsubmit() { + this.mywork.adduserdetails(this.form.value, this.token).subscribe((data) => { + console.log(data); + this.passchange = data; + this.toastr.success('Email Send successfully'); + console.log('success ', data); + }, (err) => { + this.toastr.error("Server Error"); + console.log('failure ', err); + }) + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.html b/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.html new file mode 100644 index 0000000..774fa24 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.html @@ -0,0 +1,262 @@ + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.scss b/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.scss new file mode 100644 index 0000000..1edea49 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.scss @@ -0,0 +1,653 @@ +// ======================================== +// MODERN AI-INSPIRED LOGIN PAGE STYLES +// ======================================== + +@import '../../../../styles/design-tokens'; + +// Modern Login Container +.modern-login-container { + min-height: 100vh; + display: flex; + align-items: center; + justify-content: center; + position: relative; + overflow: hidden; + background: linear-gradient(135deg, $primary-50 0%, $primary-100 50%, $secondary-50 100%); +} + +// Background Elements +.login-background { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 1; + overflow: hidden; + + .gradient-overlay { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: linear-gradient(135deg, + rgba($primary-600, 0.1) 0%, + rgba($primary-400, 0.05) 50%, + rgba($accent-purple, 0.1) 100%); + } + + .floating-shapes { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + + .shape { + position: absolute; + border-radius: 50%; + background: linear-gradient(45deg, rgba($primary-400, 0.1), rgba($accent-purple, 0.1)); + animation: float 6s ease-in-out infinite; + + &.shape-1 { + width: 200px; + height: 200px; + top: 10%; + left: 10%; + animation-delay: 0s; + } + + &.shape-2 { + width: 150px; + height: 150px; + top: 60%; + right: 15%; + animation-delay: 2s; + } + + &.shape-3 { + width: 100px; + height: 100px; + bottom: 20%; + left: 20%; + animation-delay: 4s; + } + + &.shape-4 { + width: 80px; + height: 80px; + top: 30%; + right: 30%; + animation-delay: 1s; + } + } + } +} + +// Main Content +.login-content { + position: relative; + z-index: 2; + display: grid; + grid-template-columns: 1fr 1fr; + max-width: 1200px; + width: 100%; + margin: 0 auto; + padding: $space-8; + gap: $space-12; + align-items: center; +} + +// Left Side - Branding +.login-branding { + display: flex; + align-items: center; + justify-content: center; + padding: $space-8; + + .brand-content { + text-align: center; + max-width: 400px; + } + + .logo-section { + margin-bottom: $space-8; + + .logo-container { + position: relative; + display: inline-block; + margin-bottom: $space-6; + + .logo-img { + width: 80px; + height: 80px; + object-fit: contain; + filter: drop-shadow(0 8px 16px rgba($primary-600, 0.3)); + transition: transform $duration-300 $ease-out; + } + + .logo-glow { + position: absolute; + top: -10px; + left: -10px; + right: -10px; + bottom: -10px; + background: linear-gradient(45deg, $primary-400, $accent-purple); + border-radius: 50%; + opacity: 0; + filter: blur(20px); + transition: opacity $duration-300 $ease-out; + } + + &:hover { + .logo-img { + transform: scale(1.1); + } + + .logo-glow { + opacity: 0.3; + } + } + } + + .brand-title { + font-size: $text-4xl; + font-weight: $font-bold; + color: $gray-900; + margin-bottom: $space-2; + background: linear-gradient(135deg, $primary-600, $accent-purple); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + } + + .brand-subtitle { + font-size: $text-lg; + color: $gray-600; + font-weight: $font-medium; + } + } + + .brand-features { + display: flex; + flex-direction: column; + gap: $space-4; + + .feature-item { + display: flex; + align-items: center; + gap: $space-3; + padding: $space-3; + background: rgba(255, 255, 255, 0.8); + border-radius: $radius-lg; + backdrop-filter: $backdrop-blur-sm; + border: 1px solid rgba(255, 255, 255, 0.2); + transition: all $duration-200 $ease-out; + + &:hover { + transform: translateX(8px); + background: rgba(255, 255, 255, 0.9); + box-shadow: $shadow-md; + } + + .feature-icon { + color: $primary-600; + font-size: $text-lg; + } + + span { + font-size: $text-sm; + font-weight: $font-medium; + color: $gray-700; + } + } + } +} + +// Right Side - Login Form +.login-form-section { + display: flex; + align-items: center; + justify-content: center; + padding: $space-8; + + .form-container { + width: 100%; + max-width: 400px; + background: rgba(255, 255, 255, 0.95); + backdrop-filter: $backdrop-blur-md; + border-radius: $radius-2xl; + padding: $space-8; + box-shadow: $shadow-xl; + border: 1px solid rgba(255, 255, 255, 0.2); + } + + .form-header { + text-align: center; + margin-bottom: $space-8; + + .form-title { + font-size: $text-2xl; + font-weight: $font-bold; + color: $gray-900; + margin-bottom: $space-2; + } + + .form-subtitle { + font-size: $text-sm; + color: $gray-600; + } + } + + .modern-login-form { + .form-group { + margin-bottom: $space-6; + + .form-label { + display: block; + font-size: $text-sm; + font-weight: $font-semibold; + color: $gray-700; + margin-bottom: $space-2; + } + + .input-container { + position: relative; + display: flex; + align-items: center; + + .input-icon { + position: absolute; + left: $space-3; + color: $gray-400; + font-size: $text-base; + z-index: 2; + } + + .modern-input { + width: 100%; + padding: $space-3 $space-3 $space-3 $space-10; + border: 2px solid $gray-200; + border-radius: $radius-lg; + font-size: $text-sm; + font-weight: $font-medium; + color: $gray-900; + background: $white; + transition: all $duration-200 $ease-out; + + &::placeholder { + color: $gray-400; + } + + &:focus { + outline: none; + border-color: $primary-500; + box-shadow: 0 0 0 3px rgba($primary-500, 0.1); + } + + &:hover { + border-color: $gray-300; + } + } + + // Password field with toggle button + &:has(.password-toggle) .modern-input { + padding-right: $space-10; + } + + .password-toggle { + position: absolute; + right: $space-3; + top: 50%; + transform: translateY(-50%); + background: none; + border: none; + color: $gray-400; + cursor: pointer; + padding: $space-1; + border-radius: $radius-sm; + transition: all $duration-200 $ease-out; + z-index: 2; + + &:hover { + color: $gray-600; + background: rgba($gray-100, 0.5); + } + + &:focus { + outline: none; + color: $primary-600; + background: rgba($primary-50, 0.5); + } + + clr-icon { + font-size: $text-base; + } + + .toggle-text { + font-size: $text-xs; + font-weight: $font-semibold; + color: inherit; + text-transform: uppercase; + letter-spacing: 0.05em; + } + } + } + } + + .form-options { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: $space-6; + + .checkbox-container { + display: flex; + align-items: center; + gap: $space-2; + cursor: pointer; + + .modern-checkbox { + width: 18px; + height: 18px; + accent-color: $primary-600; + } + + .checkbox-label { + font-size: $text-sm; + color: $gray-600; + font-weight: $font-medium; + } + } + + .forgot-link { + font-size: $text-sm; + color: $primary-600; + text-decoration: none; + font-weight: $font-medium; + transition: color $duration-200 $ease-out; + + &:hover { + color: $primary-700; + } + } + } + + .error-message { + display: flex; + align-items: center; + gap: $space-2; + padding: $space-3; + background: rgba($accent-red, 0.1); + border: 1px solid rgba($accent-red, 0.2); + border-radius: $radius-lg; + margin-bottom: $space-6; + color: $accent-red; + font-size: $text-sm; + font-weight: $font-medium; + + clr-icon { + font-size: $text-base; + } + } + + .modern-login-btn { + width: 100%; + padding: $space-4; + background: linear-gradient(135deg, $primary-600, $primary-700); + color: $white; + border: none; + border-radius: $radius-lg; + font-size: $text-base; + font-weight: $font-semibold; + cursor: pointer; + transition: all $duration-200 $ease-out; + position: relative; + overflow: hidden; + + &:hover:not(:disabled) { + transform: translateY(-2px); + box-shadow: $shadow-lg; + background: linear-gradient(135deg, $primary-700, $primary-800); + } + + &:active { + transform: translateY(0); + } + + &:disabled { + opacity: 0.6; + cursor: not-allowed; + transform: none; + } + + &.loading { + .btn-content { + opacity: 0; + } + + .btn-loading { + opacity: 1; + } + } + + .btn-content { + display: flex; + align-items: center; + justify-content: center; + gap: $space-2; + transition: opacity $duration-200 $ease-out; + } + + .btn-loading { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + display: flex; + align-items: center; + gap: $space-2; + opacity: 0; + transition: opacity $duration-200 $ease-out; + + .spinner { + width: 16px; + height: 16px; + border: 2px solid rgba(255, 255, 255, 0.3); + border-top: 2px solid $white; + border-radius: 50%; + animation: spin 1s linear infinite; + } + } + } + + .signup-section { + text-align: center; + margin-top: $space-6; + + .signup-text { + font-size: $text-sm; + color: $gray-600; + + .signup-link { + color: $primary-600; + text-decoration: none; + font-weight: $font-semibold; + transition: color $duration-200 $ease-out; + + &:hover { + color: $primary-700; + } + } + } + } + } + + .social-login { + margin-top: $space-8; + + .divider { + position: relative; + text-align: center; + margin-bottom: $space-6; + + &::before { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 1px; + background: $gray-200; + } + + span { + background: rgba(255, 255, 255, 0.95); + padding: 0 $space-4; + font-size: $text-xs; + color: $gray-500; + font-weight: $font-medium; + } + } + + .social-buttons { + display: grid; + grid-template-columns: 1fr 1fr; + gap: $space-3; + + .social-btn { + display: flex; + align-items: center; + justify-content: center; + gap: $space-2; + padding: $space-3; + border: 2px solid $gray-200; + border-radius: $radius-lg; + background: $white; + color: $gray-700; + font-size: $text-sm; + font-weight: $font-medium; + cursor: pointer; + transition: all $duration-200 $ease-out; + + &:hover { + border-color: $gray-300; + transform: translateY(-1px); + box-shadow: $shadow-md; + } + + &.google-btn:hover { + border-color: #db4437; + color: #db4437; + } + + &.microsoft-btn:hover { + border-color: #0078d4; + color: #0078d4; + } + + clr-icon { + font-size: $text-base; + } + } + } + } +} + +// Animations +@keyframes float { + 0%, 100% { + transform: translateY(0px) rotate(0deg); + } + 50% { + transform: translateY(-20px) rotate(180deg); + } +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +// Responsive Design +@media (max-width: $breakpoint-lg) { + .login-content { + grid-template-columns: 1fr; + gap: $space-8; + padding: $space-6; + } + + .login-branding { + order: 2; + padding: $space-4; + + .brand-content { + max-width: 100%; + } + + .logo-section .brand-title { + font-size: $text-3xl; + } + + .brand-features { + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + } + } + + .login-form-section { + order: 1; + padding: $space-4; + + .form-container { + padding: $space-6; + } + } +} + +@media (max-width: $breakpoint-md) { + .modern-login-container { + padding: $space-4; + } + + .login-content { + padding: $space-4; + } + + .login-branding { + .brand-features { + flex-direction: column; + } + } + + .login-form-section .form-container { + padding: $space-4; + } +} + +// Legacy styles (preserved for compatibility) +.tamplate1 { + background-image: url(../../../../assets/images/new.png); + background-repeat: no-repeat; + background-size: 60%; + background-position: right center; + border: 1px solid #000; +} + +.tamplate2 { + background-image: url(../../../../assets/images/new.png); + background-repeat: no-repeat; + background-size: 60%; + background-position: left center; + display: flex; + justify-content: flex-end; + align-items: center; + border: 1px solid #000; +} + +.signup { + cursor: pointer; +} + diff --git a/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.spec.ts new file mode 100644 index 0000000..fe42df4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginPageComponent } from './login-page.component'; + +describe('LoginPageComponent', () => { + let component: LoginPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LoginPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.ts b/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.ts new file mode 100644 index 0000000..d31362b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/login-page/login-page.component.ts @@ -0,0 +1,170 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { LoginService } from '../../../services/api/login.service'; +import { ActivatedRoute} from '@angular/router'; +import { HttpErrorResponse } from '@angular/common/http'; +import { ToastrService } from 'ngx-toastr'; +import{environment} from 'src/environments/environment'; +// import { ExtendedLoginEnvironment, LoginEnvironment } from './login_environment'; +//import { UserRegistrationService } from 'src/app/services/api/user-registration.service'; +import { LoginEnvironment } from './login_environment'; + + +@Component({ + selector: 'app-login-page', + templateUrl: './login-page.component.html', + styleUrls: ['./login-page.component.scss'] +}) +export class LoginPageComponent implements OnInit { + + loginEnvironment = LoginEnvironment; + showLogin2 = true; + + + // loginEnvironment: LoginEnvironment = { + // companyName: 'io8.dev', + // imagePath: '../../../../assets/images/new.png', + // fpass: 'forgot password', + // isSignup: true, + // // template:'', + // }; + + + // loginEnvironment: ExtendedLoginEnvironment = { + // companyName: 'io8.dev', + // imagePath: '../../../../assets/images/new.png', + // fpass: 'Forgot Password?', + // isSignup: true // or false based on your requirement + // }; + + + email = ''; + password = ''; + isError = false; + isLoading = false; + showPassword = false; + + model: any = {}; + errMsg: string = ''; + constructor( + private router: Router, + private route:ActivatedRoute, + private loginService: LoginService, + private toastr: ToastrService, + ) { } + + ngOnInit() { + this.loginService.logout(false); + + this.loginEnvironment["imagePath"] = !this.loginEnvironment.loginImageURL ? "../../../../assets/images/new.png" : this.loginEnvironment.loginImageURL; + + console.log('Login Environment:', this.loginEnvironment); + } + + getWrapperClass(): string { + if (this.loginEnvironment.templateNo === 'Template 1') { + return 'login-wrapper tamplate1'; + + } else if (this.loginEnvironment.templateNo === 'Template 2') { + return 'login-wrapper tamplate2'; + } else if (this.loginEnvironment.templateNo === '') { + return 'login-wrapper tamplate1'; // Default class or empty string if no match + } + } + + onLogin() { + console.log('onLogin called'); + console.log('Form data:', { email: this.model.email, password: this.model.password }); + + // Reset error state + this.isError = false; + this.errMsg = ''; + + // Validate inputs + if (!this.model.email || !this.model.password) { + this.isError = true; + this.errMsg = 'Please enter both email and password'; + console.log('Validation failed - missing email or password'); + return; + } + + // Set loading state + this.isLoading = true; + console.log('Loading state set to true, making API call...'); + + // tslint:disable-next-line:max-line-length + this.loginService.getToken(this.model.email, this.model.password) + .subscribe( + resp => { + console.log('API Response received:', resp); + this.isLoading = false; + + // Handle different response formats + if (resp.operationStatus === 'ERROR') { + this.isError = true; + this.errMsg = resp.operationMessage || 'Login failed'; + return; + } + // Handle different response formats + if (resp.success === 'false') { + this.isError = true; + this.errMsg = resp.message || 'Login failed'; + return; + } + if (resp.user === undefined || resp.user.token === undefined || resp.user.token === "INVALID") { + this.isError = true; + this.errMsg = 'Invalid email or password'; + return; + } + + // Success - navigate to landing page + console.log('Login successful, navigating to:', resp.landingPage); + this.router.navigate([resp.landingPage]); + }, + (errResponse: HttpErrorResponse) => { + console.log('API Error received:', errResponse); + this.isLoading = false; + this.isError = true; + + switch (errResponse.status) { + case 401: + this.errMsg = 'Email or password is incorrect'; + break; + case 404: + this.errMsg = 'Service not found'; + break; + case 408: + this.errMsg = 'Request timeout'; + break; + case 500: + this.errMsg = 'Internal server error'; + break; + case 0: + this.errMsg = 'Network error - please check your connection'; + break; + default: + this.errMsg = 'An error occurred. Please try again.'; + } + } + ); + } + goaccount(){ + } + goforgotpass(){ + this.router.navigate(["../forgotpass"], { relativeTo: this.route }); + } + + // Clear error when user starts typing + clearError() { + if (this.isError) { + this.isError = false; + this.errMsg = ''; + } + } + + // Toggle password visibility + togglePasswordVisibility() { + this.showPassword = !this.showPassword; + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/login-page/login_environment.ts b/frontend/angular-clarity-master/src/app/modules/login/login-page/login_environment.ts new file mode 100644 index 0000000..c6eaeef --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/login-page/login_environment.ts @@ -0,0 +1,15 @@ + + +export const LoginEnvironment = { + + "templateNo": "Template 1", + "loginHeading": "Welcome", + "loginHeading2": "io8.dev1", + "isSignup": "true", + "loginSignup": "Use your ID to sign in OR ", + "loginSignup2": "create one now", + "loginForgotpass": "FORGOT PASSWORD?", + "loginImage": "[]", + "loginImageURL": "null" + +} diff --git a/frontend/angular-clarity-master/src/app/modules/login/login-routing.module.ts b/frontend/angular-clarity-master/src/app/modules/login/login-routing.module.ts new file mode 100644 index 0000000..d0e2a2f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/login-routing.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { AddguestComponent } from './addguest/addguest.component'; +import { ForgotpasswordComponent } from './forgotpassword/forgotpassword.component'; +import { ForgotresetpasswordComponent } from './forgotresetpassword/forgotresetpassword.component'; +import { Forgotresetpassword1Component } from './forgotresetpassword1/forgotresetpassword1.component'; + +import { LoginPageComponent } from './login-page/login-page.component'; +import { EmailverificationComponent } from './emailverification/emailverification.component'; +import { AboutWorkComponent } from './about-work/about-work.component'; + +const routes: Routes = [ + { path: 'login', component: LoginPageComponent }, + {path: 'forgotpass', component:ForgotpasswordComponent}, + {path:'forgotresetpassword/:id', component:ForgotresetpasswordComponent}, + {path:'adduser/:id', component:Forgotresetpassword1Component}, + {path:'addguest/:id', component:AddguestComponent}, + + { path: 'email-verification', component: EmailverificationComponent }, + {path: 'about-work', component:AboutWorkComponent}, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class LoginRoutingModule { } diff --git a/frontend/angular-clarity-master/src/app/modules/login/login.module.ts b/frontend/angular-clarity-master/src/app/modules/login/login.module.ts new file mode 100644 index 0000000..afc5e7d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/login/login.module.ts @@ -0,0 +1,30 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ClarityModule } from '@clr/angular'; +import { NgxCaptchaModule } from 'ngx-captcha'; + +import { LoginRoutingModule } from './login-routing.module'; +import { LoginPageComponent } from './login-page/login-page.component'; +import { ForgotpasswordComponent } from './forgotpassword/forgotpassword.component'; +import { ForgotresetpasswordComponent } from './forgotresetpassword/forgotresetpassword.component'; +import { Forgotresetpassword1Component } from './forgotresetpassword1/forgotresetpassword1.component'; +import { AddguestComponent } from './addguest/addguest.component'; + +import { EmailverificationComponent } from './emailverification/emailverification.component'; +import { AboutWorkComponent } from './about-work/about-work.component'; +import { SanitizePipe } from 'src/app/pipes/sanitize.pipe'; + +@NgModule({ + declarations: [LoginPageComponent, ForgotpasswordComponent, ForgotresetpasswordComponent, Forgotresetpassword1Component, AddguestComponent, + EmailverificationComponent, AboutWorkComponent,SanitizePipe], + imports: [ + CommonModule, + FormsModule, + ClarityModule, + LoginRoutingModule, + ReactiveFormsModule, + NgxCaptchaModule, + ] +}) +export class LoginModule { } diff --git a/frontend/angular-clarity-master/src/app/modules/logo/logo.component.html b/frontend/angular-clarity-master/src/app/modules/logo/logo.component.html new file mode 100644 index 0000000..2ce72ee --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/logo/logo.component.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/logo/logo.component.scss b/frontend/angular-clarity-master/src/app/modules/logo/logo.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/logo/logo.component.ts b/frontend/angular-clarity-master/src/app/modules/logo/logo.component.ts new file mode 100644 index 0000000..cb0dad1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/logo/logo.component.ts @@ -0,0 +1,17 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-logo', + templateUrl: './logo.component.html', + styleUrls: ['./logo.component.scss'] +}) +export class LogoComponent implements OnInit { + + + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.html new file mode 100644 index 0000000..0c87d72 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.html @@ -0,0 +1,417 @@ + +
+
+
+

Ad10

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + Description + + + + Active + + + + + + + + Action + + + + + +{{user.name }} + + + + + + +{{user.active }} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.ts new file mode 100644 index 0000000..aebc753 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.component.ts @@ -0,0 +1,314 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Ad10service} from './Ad10.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Ad10cardvariable } from './Ad10_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Ad10', + templateUrl: './Ad10.component.html', + styleUrls: ['./Ad10.component.scss'] +}) +export class Ad10Component implements OnInit { + cardButton = Ad10cardvariable.cardButton; + cardmodeldata = Ad10cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Ad10cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Ad10_formCode' +tableName = 'Ad10'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Ad10service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + +description : [null], + +active : [true], + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Ad10_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +rsModaldescription = false; +goToReplaceStringdescription(row){ +this.rowSelected = row; this.rsModaldescription =true; } + + + +// payment code start + checkoutModal = false; + checkout(){ this.checkoutModal = true; } +paytmPay(){ + this.checkoutModal = false; console.log('Paytm Payment started'); + this.mainService.paytmPay(this.entryForm.value).subscribe(data=>{ + console.log(data); this.onSubmit(); },(error)=>{ + console.log(error); }); } orderData = { + amount: '', }; + razorPay(){ + this.checkoutModal = false; + this.orderData.amount = this.entryForm.value.amount; + console.log('Razorpay Payment started'); + this.mainService.razorPay(this.orderData).subscribe(data=>{ + console.log(data); this.onSubmit(); },(error)=>{ + console.log(error); }); } // payment code end + +// updateaction +} + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.service.ts new file mode 100644 index 0000000..eac44d4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10.service.ts @@ -0,0 +1,47 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Ad10service{ + private baseURL = "Ad10/Ad10" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + +// payment code start + paytmPay(data: any): Observable { + const url = `payment/start`; return this.apiRequest.post(url, data); + } +razorPay(orderData: any): Observable { + const url = `payment/razorpay/create-order`; + return this.apiRequest.post(url, orderData); } // payment code end + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10_cardvariable.ts new file mode 100644 index 0000000..1821b1a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad10/Ad10_cardvariable.ts @@ -0,0 +1,4 @@ +export const Ad10cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.html new file mode 100644 index 0000000..760b3cc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.html @@ -0,0 +1,537 @@ + +
+
+
+

Ad6

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + description + + + + country + + + + state + + + + district + + + + + + Action + + + + + + {{user.name }} + + + {{user.description }} + + + {{user. countryidentifier}} + + + {{user.state }} + + + {{user.district }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.ts new file mode 100644 index 0000000..1f089fb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.component.ts @@ -0,0 +1,417 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Ad6service } from './Ad6.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Ad6cardvariable } from './Ad6_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Ad6', + templateUrl: './Ad6.component.html', + styleUrls: ['./Ad6.component.scss'] +}) +export class Ad6Component implements OnInit { + cardButton = Ad6cardvariable.cardButton; + cardmodeldata = Ad6cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Ad6cardvariable.cardButton; + cardmodal; changeView() { + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine: any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Ad6_formCode' + tableName = 'Ad6'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Ad6service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; + // component button + ngOnInit(): void { + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + name: [null], + + description: [null], + + country: [null], + + state: [null], + + + district: [null], + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Ad6_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + this.getallcountry(); + + + + if (this.countrydefault) { + // Listen for product changes to auto-fill description + + this.entryForm.get('country')?.valueChanges.subscribe(name => { + if (name && this.selectcountry) { + + const found = this.selectcountry.find(p => p.name === name); + + + + console.log('found is ', found); + + // Auto-fill price when product is selected + if (found && found.default_field) { + this.entryForm.patchValue({ default_field: found.default_field_link }); + } else { + this.entryForm.patchValue({ default_field: null }); + } + + } + }); + } + // Listen for country changes + + + this.entryForm.get('country')?.valueChanges.subscribe((item) => { + + + if (item) { + this.dependet2state(item); + } else { + this.statedependentData = []; + this.entryForm.get('state')?.setValue(null); // clear state + } + }); + + + + // Listen for country changes + + + this.entryForm.get('state')?.valueChanges.subscribe((item) => { + + + if (item) { + this.dependet2district(item); + } else { + this.districtdependentData = []; + this.entryForm.get('district')?.setValue(null); // clear state + } + }); + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; + this.product = [...this.product].reverse(); if (this.product.length == 0) { + this.error = "No Data Available" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + // Dependemt Dropdown field start + this.dependet2state(row.dependentDD); + // Dependemt Dropdown field end + + // Dependemt Dropdown field start + this.dependet2district(row.dependentDD); + // Dependemt Dropdown field end + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; this.submitted = false; + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + + countrydefault = false + selectcountry; + getallcountry() { + this.mainService.getAllcountry().subscribe(data => { + this.selectcountry = data; + console.log(data); + }, (error) => { console.log(error); }); + } + + + + // ================== ORDER SUMMARY LOGIC START ================== + /** + * Order Summary Array and Methods for Add to Order functionality + */ + countrySummary: any[] = []; + countrytotal; + iscountryorder = false; + /** + * Add selected product to order summary + */ + addcountryOrder() { + const formValue = this.entryForm.value; + if (!formValue.country) { + this.toastr.error('Please select country'); + return; + } + // Get description from master (selectcountry) + + + + + if (this.selectcountry && Array.isArray(this.selectcountry)) { + + + const found = this.selectcountry.find(p => p.name === formValue.country); + + + + + } + const line = this.countrySummary.length + 1; + const orderItem = { + line: line, + + // unitPrice: Number(formValue.price), + // quantity: Number(formValue.quantity), + // total: Number(formValue.price) * Number(formValue.quantity) + }; + this.countrySummary.push(orderItem); + + this.countrytotal = ''; + } + + /** + * Remove item from order summary by index + */ + removecountryOrder(index: number) { + this.countrySummary.splice(index, 1); + // Recalculate line numbers + this.countrySummary.forEach((item, i) => { + item.line = i + 1; + }); + } + + /** + * Calculate subtotal of all order items + */ + getcountrySubtotal(): number { + return this.countrySummary.reduce((sum, item) => sum + item.total, 0); + } + + /** + * Calculate GST (18%) + */ + getcountryGST(): number { + return this.getcountrySubtotal() * 0.18; + } + + /** + * Calculate grand total (subtotal + GST) + */ + getcountryGrandTotal(): number { + return this.getcountrySubtotal() + this.getcountryGST(); + + } + // ================== ORDER SUMMARY LOGIC END ================== + + + // Dependemt Dropdown field start + + + statedependentData: any; + dependet2state(item) { + this.mainService.getstateDependent(item).subscribe((data) => { + console.log(data); + this.statedependentData = data; + }, (error) => { console.log(error); }); + } + + + // DependemtDropdown field end + + // Dependemt Dropdown field start + + + districtdependentData: any; + dependet2district(item) { + this.mainService.getdistrictDependent(item).subscribe((data) => { + console.log(data); + this.districtdependentData = data; + }, (error) => { console.log(error); }); + } + + + // DependemtDropdown field end + + // updateaction +} + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.service.ts new file mode 100644 index 0000000..fb34d50 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6.service.ts @@ -0,0 +1,56 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Ad6service{ + private baseURL = "Ad6/Ad6" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + +getAllcountry(): Observable { +return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + + + + getstateDependent(field: string): Observable { + return this.apiRequest.get("State_ListFilter1/State_ListFilter11/" + field); + } + + + + + + getdistrictDependent(field: string): Observable { + return this.apiRequest.get("District_ListFilter1/District_ListFilter11/" + field); + } + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6_cardvariable.ts new file mode 100644 index 0000000..a7602db --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad6/Ad6_cardvariable.ts @@ -0,0 +1,4 @@ +export const Ad6cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.html new file mode 100644 index 0000000..0d98c81 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.html @@ -0,0 +1,421 @@ + +
+
+
+

Ad7

+
+
+ + + + + + + + + + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + + + + + + + Action + + + + + +{{user.name }} + + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.ts new file mode 100644 index 0000000..7c15c86 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.component.ts @@ -0,0 +1,379 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Ad7service} from './Ad7.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Ad7cardvariable } from './Ad7_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Ad7', + templateUrl: './Ad7.component.html', + styleUrls: ['./Ad7.component.scss'] +}) +export class Ad7Component implements OnInit { + cardButton = Ad7cardvariable.cardButton; + cardmodeldata = Ad7cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Ad7cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Ad7_formCode' +tableName = 'Ad7'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Ad7service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + public insertFormButton_Field2: FormGroup; + + + public insertFormButton_Field: FormGroup; + + + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + + + + + + + + + + + + + }); // component_button200 +// inser code start + this.insertFormButton_Field2 = this._fb.group({ + description: 'textarea', + name: '', + }); + + // insert code end + +// inser code start + this.insertFormButton_Field = this._fb.group({ + active: 'toggle_switch', + description: 'textarea', + name: 'text', + }); + + // insert code end + + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Ad7_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + + + + + +// updateaction + +// insert button + + +modalInsertButton_Field2 = false; +goToInsertButton_Field2() { + this.modalInsertButton_Field2=true; + } +onSubmitInsertButton_Field2() { + console.log(this.insertFormButton_Field2.value); + this.submitted=true; + if (this.insertFormButton_Field2.invalid) { + return; + } + this.onInsertButton_Field2(); +} +onInsertButton_Field2() { + this.modalInsertButton_Field2=false; + this.mainService.insertButton_Field2Support(this.insertFormButton_Field2.value).subscribe(data => { + console.log('After add',data) + if (data.status >=200 && data.status <=209) { + this.toastr.success('Added successfully'); + } +if (data && data.id != null) { + this.toastr.success('Added successfully'); + } this.ngOnInit(); + },(error) => { + console.error(error); + if ( error.status >= 200 && error.status <= 299) { + this.toastr.success("Update Successfully"); + } + if ( error.status >= 400 && error.status <= 499) { + this.toastr.error("Update Failed"); + } + if ( error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + } + this.ngOnInit(); + }); + this.insertFormButton_Field2.reset(); + } +// insert buuton code end + + + +// insert button + + +modalInsertButton_Field = false; +goToInsertButton_Field() { + this.modalInsertButton_Field=true; + } +onSubmitInsertButton_Field() { + console.log(this.insertFormButton_Field.value); + this.submitted=true; + if (this.insertFormButton_Field.invalid) { + return; + } + this.onInsertButton_Field(); +} +onInsertButton_Field() { + this.modalInsertButton_Field=false; + this.mainService.insertButton_FieldCountry(this.insertFormButton_Field.value).subscribe(data => { + console.log('After add',data) + if (data.status >=200 && data.status <=209) { + this.toastr.success('Added successfully'); + } +if (data && data.id != null) { + this.toastr.success('Added successfully'); + } this.ngOnInit(); + },(error) => { + console.error(error); + if ( error.status >= 200 && error.status <= 299) { + this.toastr.success("Update Successfully"); + } + if ( error.status >= 400 && error.status <= 499) { + this.toastr.error("Update Failed"); + } + if ( error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + } + this.ngOnInit(); + }); + this.insertFormButton_Field.reset(); + } +// insert buuton code end + + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.service.ts new file mode 100644 index 0000000..1ef2c02 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7.service.ts @@ -0,0 +1,49 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Ad7service{ + private baseURL = "Ad7/Ad7" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + +// updateaction +// insert button code start +insertButton_Field2Support(Support: any): Observable { + return this.apiRequest.post(`Ad7/Ad7/Support_insert`, Support); +} + +// insert button code start +insertButton_FieldCountry(Country: any): Observable { + return this.apiRequest.post(`Ad7/Ad7/Country_insert`, Country); +} + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7_cardvariable.ts new file mode 100644 index 0000000..e211fcd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad7/Ad7_cardvariable.ts @@ -0,0 +1,4 @@ +export const Ad7cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.html new file mode 100644 index 0000000..1615499 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.html @@ -0,0 +1,619 @@ + +
+
+
+

Ad8

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + + + + + + + description + + + + name + + + + + + + + + Action + + + + + +{{user.name }} + + + + + + + + +{{user.support?.description}} + + + +{{user.support?.name}} + + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.ts new file mode 100644 index 0000000..6445dbe --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.component.ts @@ -0,0 +1,478 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Ad8service} from './Ad8.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Ad8cardvariable } from './Ad8_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Ad8', + templateUrl: './Ad8.component.html', + styleUrls: ['./Ad8.component.scss'] +}) +export class Ad8Component implements OnInit { + cardButton = Ad8cardvariable.cardButton; + cardmodeldata = Ad8cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Ad8cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Ad8_formCode' +tableName = 'Ad8'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Ad8service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + public UpdateFormButtonupdate2: FormGroup; + + + public UpdateFormButtonUpdate: FormGroup; + + + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + + + + + +support: this.supportinitLinesForm(), + +childform: this._fb.array([this.initchildformForm()]), + + + + + + + + + + + + + }); // component_button200 +// inser code start + this.UpdateFormButtonupdate2 = this._fb.group({ + active: '', + description: '', + name: '', + }); + + // Update code end + +// inser code start + this.UpdateFormButtonUpdate = this._fb.group({ + description: '', + name: '', + }); + + // Update code end + + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Ad8_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + +supportinitLinesForm() { return this._fb.group({ + + + description: [null], + + + + name: [null], + + + +}); } + + +// one to many start + initchildformForm() { return this._fb.group({ + + + + active: [null], + + + + description: [null], + + + + name: [null], + + + +}); } +get childformcontrols() {return (this.entryForm.get("childform") as FormArray).controls; } +onAddchildform() { +(this.entryForm.get("childform")).push(this.initchildformForm()); } +onRemovechildform(index: number) { +(this.entryForm.get("childform")).removeAt(index); } + oneditchildform() { this.childformcomponents.push({ + + +active: "", + + + +description: "", + + + +name: "", + + + + }); } + deletechildformRow(index) { + this.childformcomponents.splice(index, 1); + } +childformcomponents; + // one to many end + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + +this.childformcomponents = row.childform; + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + + + + + + + + + +// updateaction + +// update button + + +modalUpdateButtonupdate2 = false; +goToUpdateButtonupdate2() { + this.modalUpdateButtonupdate2=true; + } +onSubmitUpdateButtonupdate2(id) { + console.log(this.UpdateFormButtonupdate2.value); + this.submitted=true; + if (this.UpdateFormButtonupdate2.invalid) { + return; + } + this.onUpdateButtonupdate2(id); +} +onUpdateButtonupdate2(id) { + this.modalUpdateButtonupdate2=false; + this.mainService.updateChildform(id,this.UpdateFormButtonupdate2.value).subscribe(data => { + console.log(data) + if (data.status >=200 && data.status <=209) { + this.toastr.success('Added successfully'); + } + this.ngOnInit(); + },(error) => { + console.error(error); + if ( error.status >= 200 && error.status <= 299) { + this.toastr.success("Update Successfully"); + } + if ( error.status >= 400 && error.status <= 499) { + this.toastr.error("Update Failed"); + } + if ( error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + } + this.ngOnInit(); + }); + this.UpdateFormButtonupdate2.reset(); + } +// update buuton code end + + + +// update button + + +modalUpdateButtonUpdate = false; +goToUpdateButtonUpdate() { + this.modalUpdateButtonUpdate=true; + } +onSubmitUpdateButtonUpdate(id) { + console.log(this.UpdateFormButtonUpdate.value); + this.submitted=true; + if (this.UpdateFormButtonUpdate.invalid) { + return; + } + this.onUpdateButtonUpdate(id); +} +onUpdateButtonUpdate(id) { + this.modalUpdateButtonUpdate=false; + this.mainService.updateSupport(id,this.UpdateFormButtonUpdate.value).subscribe(data => { + console.log(data) + if (data.status >=200 && data.status <=209) { + this.toastr.success('Added successfully'); + } + this.ngOnInit(); + },(error) => { + console.error(error); + if ( error.status >= 200 && error.status <= 299) { + this.toastr.success("Update Successfully"); + } + if ( error.status >= 400 && error.status <= 499) { + this.toastr.error("Update Failed"); + } + if ( error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + } + this.ngOnInit(); + }); + this.UpdateFormButtonUpdate.reset(); + } +// update buuton code end + + +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.service.ts new file mode 100644 index 0000000..30e6ea9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8.service.ts @@ -0,0 +1,53 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Ad8service{ + private baseURL = "Ad8/Ad8" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + +// updateaction +// update button code start +updateChildform(id: number,Childform: any): Observable { + return this.apiRequest.put(`Childform/Childform_update/`+ id, Childform); +} + +// update button code start +updateSupport(id: number,Support: any): Observable { + return this.apiRequest.put(`Support/Support_update/`+ id, Support); +} + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8_cardvariable.ts new file mode 100644 index 0000000..b377f58 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad8/Ad8_cardvariable.ts @@ -0,0 +1,4 @@ +export const Ad8cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.html new file mode 100644 index 0000000..77ced78 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.html @@ -0,0 +1,420 @@ + +
+
+
+

Ad9

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + + + + + Action + + + + + +{{user.name }} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.ts new file mode 100644 index 0000000..65bcd67 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.component.ts @@ -0,0 +1,282 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Ad9service} from './Ad9.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Ad9cardvariable } from './Ad9_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Ad9', + templateUrl: './Ad9.component.html', + styleUrls: ['./Ad9.component.scss'] +}) +export class Ad9Component implements OnInit { + cardButton = Ad9cardvariable.cardButton; + cardmodeldata = Ad9cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Ad9cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Ad9_formCode' +tableName = 'Ad9'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Ad9service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + +approved_field_status : [null], + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Ad9_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + +approved_field_tablename = 'Ad9' + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + this.serverData = []; + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + +// approve code + this.serverData = this.serverData.map((item) => { + item.tablename = this.approved_field_tablename; + return item; + }); this.serverData = this.serverData.map((item) => { + item.service_order_id = data.id; + return item; }); + console.log(this.serverData); + this.serverData.forEach((item) => { + this.mainService.create_approved(item).subscribe( + (data) => { console.log(data); }) + }) // approved code end + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + + // approval code + serverData:any = []; + onAddLines() { + this.serverData.push({ formCode:"", + documentSeq:"", + approver:"", + actionType:"", +actionTaken:"", + comments:"", + actionedAt:"", + tablename:"", + service_order_id:"", }); } + onRemoveLines(index: number){ + this.serverData.splice(index, 1); + } + oneditAddLines() { + this.serverData.push({ + formCode:"", documentSeq:"", approver:"", + actionType:"", actionTaken:"", comments:"", + actionedAt:"", tablename:"", + service_order_id:"", }); } + oneditRemoveLines(index: number){ this.serverData.splice(index, 1); + } // approval code end + +// updateaction +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.service.ts new file mode 100644 index 0000000..9b477f1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9.service.ts @@ -0,0 +1,40 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Ad9service{ + private baseURL = "Ad9/Ad9" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + +// approve code + create_approved(data: any): Observable { + const _http = "billing/approval" + "/" + "add"; + return this.apiRequest.post(_http, data); } // approved code end + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9_cardvariable.ts new file mode 100644 index 0000000..dca4e0f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Ad9/Ad9_cardvariable.ts @@ -0,0 +1,4 @@ +export const Ad9cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.html new file mode 100644 index 0000000..3542316 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.html @@ -0,0 +1,1380 @@ + +
+
+
+

Adv1

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + ismale + + + + idfemale + + + + + + test1 + + + + + test2 + + + + + + + + + t1 + + + + + t2 + + + + + t4 + + + + + + + + + + + + + + + + + + + + + + + + + Action + + + + + +{{user.ismale }} + + +{{user.idfemale }} + + + + +{{user.test1}} + + + +{{user.test2}} + + + + + + + +{{user.t1}} + + + +{{user.t2}} + + + +{{user.t4}} + + + + + + + + + + + + + + + + + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.ts new file mode 100644 index 0000000..c6ec0e8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.component.ts @@ -0,0 +1,957 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Adv1service} from './Adv1.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Adv1cardvariable } from './Adv1_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Adv1', + templateUrl: './Adv1.component.html', + styleUrls: ['./Adv1.component.scss'] +}) +export class Adv1Component implements OnInit { + cardButton = Adv1cardvariable.cardButton; + cardmodeldata = Adv1cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Adv1cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Adv1_formCode' +tableName = 'Adv1'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Adv1service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +ismale : [null], + +idfemale : [null], + + + +test1:[false], + + + +test2:[false], + + + + + +t1:[false], + + + +t2:[false], + + + +t4:[false], + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Adv1_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + + + + + + + + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + + + + +FileDataImageupload_field: any[]; + selectedImageupload_field: any[]; + +FileDataImageupload_field2: any[]; + selectedImageupload_field2: any[]; + +FileDataAudio_field: any[]; + selectedAudio_field: any[]; + +FileDataAudio_field2: any[]; + selectedAudio_field2: any[]; + +FileDataVideo_field: any[]; + selectedVideo_field: any[]; + + +FileDataVideo_field2: any[]; + selectedVideo_field2: any[]; + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + this.selectedfileupload_field = []; + this.mainService.uploadfilegetByIdfileupload_field(row.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDatafileupload_field = uploaddata; + + }) + + this.selectedfileupload_field2 = []; + this.mainService.uploadfilegetByIdfileupload_field2(row.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDatafileupload_field2 = uploaddata; + + }) + + this.selectedimageupload_field = []; + this.mainService.uploadImageupload_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDataimageupload_field = uploaddata; + + }) + + this.selectedimageupload_field2 = []; + this.mainService.uploadImageupload_field2getById(row.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDataimageupload_field2 = uploaddata; + + }) + + this.selectedaudio_field = []; + this.mainService.uploadAudio_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDataaudio_field = uploaddata; + + }) + + this.selectedaudio_field2 = []; + this.mainService.uploadAudio_field2getById(row.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDataaudio_field2 = uploaddata; + + }) + + this.selectedvideo_field = []; + this.mainService.uploadVideo_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDatavideo_field = uploaddata; + + }) + + this.selectedvideo_field2 = []; + this.mainService.uploadVideo_field2getById(row.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDatavideo_field2 = uploaddata; + + }) + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + + + + + + + + + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + +for (let i = 0; i < this.selectedfileupload_field.length; i++){ + + this.mainService.uploadfilefileupload_field(data.id,this.tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedfileupload_field2.length; i++){ + + this.mainService.uploadfilefileupload_field2(data.id,this.tableName,this.selectedfileupload_field2[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedimageupload_field.length; i++){ + + this.mainService.uploadImageupload_field(data.id,this.tableName,this.selectedimageupload_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedimageupload_field2.length; i++){ + + this.mainService.uploadImageupload_field2(data.id,this.tableName,this.selectedimageupload_field2[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedaudio_field.length; i++){ + + this.mainService.uploadAudio_field(data.id,this.tableName,this.selectedaudio_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedaudio_field2.length; i++){ + + this.mainService.uploadAudio_field2(data.id,this.tableName,this.selectedaudio_field2[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedvideo_field.length; i++){ + + this.mainService.uploadVideo_field(data.id,this.tableName,this.selectedvideo_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedvideo_field2.length; i++){ + + this.mainService.uploadVideo_field2(data.id,this.tableName,this.selectedvideo_field2[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + + + + + + + + + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + +for (let i = 0; i < this.selectedfileupload_field.length; i++){ + + this.mainService.uploadfilefileupload_field(data.id,this.tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedfileupload_field2.length; i++){ + + this.mainService.uploadfilefileupload_field2(data.id,this.tableName,this.selectedfileupload_field2[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedimageupload_field.length; i++){ + + this.mainService.uploadImageupload_field(data.id,this.tableName,this.selectedimageupload_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedimageupload_field2.length; i++){ + + this.mainService.uploadImageupload_field2(data.id,this.tableName,this.selectedimageupload_field2[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedaudio_field.length; i++){ + + this.mainService.uploadAudio_field(data.id,this.tableName,this.selectedaudio_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedaudio_field2.length; i++){ + + this.mainService.uploadAudio_field2(data.id,this.tableName,this.selectedaudio_field2[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedvideo_field.length; i++){ + + this.mainService.uploadVideo_field(data.id,this.tableName,this.selectedvideo_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedvideo_field2.length; i++){ + + this.mainService.uploadVideo_field2(data.id,this.tableName,this.selectedvideo_field2[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + +this.FileDatafileupload_field = []; +this.selectedfileupload_field =[]; + +this.FileDatafileupload_field2 = []; +this.selectedfileupload_field2 =[]; + +this.FileDataImageupload_field = []; +this.selectedImageupload_field =[]; + +this.FileDataImageupload_field2 = []; +this.selectedImageupload_field2 =[]; + +this.FileDataAudio_field = []; +this.selectedAudio_field =[]; + +this.FileDataAudio_field2 = []; +this.selectedAudio_field2 =[]; + +this.FileDataVideo_field = []; +this.selectedVideo_field =[]; + +this.FileDataVideo_field2 = []; +this.selectedVideo_field2 =[]; + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} +updateismale (ismale : string): void { + this.entryForm.get('ismale').setValue(ismale); } + +updateismaleEdit(ismale : string): void { this.rowSelected.ismale = ismale } + ; + +updateidfemale (idfemale : string): void { + this.entryForm.get('idfemale').setValue(idfemale); } + +updateidfemaleEdit(idfemale : string): void { this.rowSelected.idfemale = idfemale } + ; + + + + + +filePreviewfileupload_field: string | ArrayBuffer | null = null; +FileDatafileupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedfileupload_field: File[]=[]; +public onFileChangedfileupload_field(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatafileupload_field[index].uploadedfile_name = files[i].name; + this.selectedfileupload_field.push(files[i]); + if (file.type.startsWith('file/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDatafileupload_field[index] = { + ...this.FileDatafileupload_field[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesfileupload_field(){ + this.FileDatafileupload_field.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowfileupload_field(index,id) { + this.FileDatafileupload_field.splice(index, 1); + + if(id){ + this.mainService.uploadfiledeletefileupload_field(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewfileupload_field2: string | ArrayBuffer | null = null; +FileDatafileupload_field2: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedfileupload_field2: File[]=[]; +public onFileChangedfileupload_field2(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatafileupload_field2[index].uploadedfile_name = files[i].name; + this.selectedfileupload_field2.push(files[i]); + if (file.type.startsWith('file/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDatafileupload_field2[index] = { + ...this.FileDatafileupload_field2[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesfileupload_field2(){ + this.FileDatafileupload_field2.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowfileupload_field2(index,id) { + this.FileDatafileupload_field2.splice(index, 1); + + if(id){ + this.mainService.uploadfiledeletefileupload_field2(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewimageupload_field: string | ArrayBuffer | null = null; +FileDataimageupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedimageupload_field: File[]=[]; +public onFileChangedimageupload_field(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDataimageupload_field[index].uploadedfile_name = files[i].name; + this.selectedimageupload_field.push(files[i]); + if (file.type.startsWith('image/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDataimageupload_field[index] = { + ...this.FileDataimageupload_field[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesimageupload_field(){ + this.FileDataimageupload_field.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowimageupload_field(index,id) { + this.FileDataimageupload_field.splice(index, 1); + + if(id){ + this.mainService.uploadImageupload_fielddelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewimageupload_field2: string | ArrayBuffer | null = null; +FileDataimageupload_field2: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedimageupload_field2: File[]=[]; +public onFileChangedimageupload_field2(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDataimageupload_field2[index].uploadedfile_name = files[i].name; + this.selectedimageupload_field2.push(files[i]); + if (file.type.startsWith('image/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDataimageupload_field2[index] = { + ...this.FileDataimageupload_field2[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesimageupload_field2(){ + this.FileDataimageupload_field2.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowimageupload_field2(index,id) { + this.FileDataimageupload_field2.splice(index, 1); + + if(id){ + this.mainService.uploadImageupload_field2delete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewaudio_field: string | ArrayBuffer | null = null; +FileDataaudio_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedaudio_field: File[]=[]; +public onFileChangedaudio_field(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDataaudio_field[index].uploadedfile_name = files[i].name; + this.selectedaudio_field.push(files[i]); + if (file.type.startsWith('audio/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDataaudio_field[index] = { + ...this.FileDataaudio_field[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesaudio_field(){ + this.FileDataaudio_field.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowaudio_field(index,id) { + this.FileDataaudio_field.splice(index, 1); + + if(id){ + this.mainService.uploadAudio_fielddelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewaudio_field2: string | ArrayBuffer | null = null; +FileDataaudio_field2: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedaudio_field2: File[]=[]; +public onFileChangedaudio_field2(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDataaudio_field2[index].uploadedfile_name = files[i].name; + this.selectedaudio_field2.push(files[i]); + if (file.type.startsWith('audio/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDataaudio_field2[index] = { + ...this.FileDataaudio_field2[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesaudio_field2(){ + this.FileDataaudio_field2.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowaudio_field2(index,id) { + this.FileDataaudio_field2.splice(index, 1); + + if(id){ + this.mainService.uploadAudio_field2delete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewvideo_field: string | ArrayBuffer | null = null; +FileDatavideo_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedvideo_field: File[]=[]; +public onFileChangedvideo_field(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatavideo_field[index].uploadedfile_name = files[i].name; + this.selectedvideo_field.push(files[i]); + if (file.type.startsWith('video/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDatavideo_field[index] = { + ...this.FileDatavideo_field[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesvideo_field(){ + this.FileDatavideo_field.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowvideo_field(index,id) { + this.FileDatavideo_field.splice(index, 1); + + if(id){ + this.mainService.uploadVideo_fielddelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewvideo_field2: string | ArrayBuffer | null = null; +FileDatavideo_field2: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedvideo_field2: File[]=[]; +public onFileChangedvideo_field2(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatavideo_field2[index].uploadedfile_name = files[i].name; + this.selectedvideo_field2.push(files[i]); + if (file.type.startsWith('video/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDatavideo_field2[index] = { + ...this.FileDatavideo_field2[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesvideo_field2(){ + this.FileDatavideo_field2.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowvideo_field2(index,id) { + this.FileDatavideo_field2.splice(index, 1); + + if(id){ + this.mainService.uploadVideo_field2delete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +// updateaction +} + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.service.ts new file mode 100644 index 0000000..ab39515 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1.service.ts @@ -0,0 +1,161 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Adv1service{ + private baseURL = "Adv1/Adv1" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + uploadfilefileupload_field(ref:any, Adv1:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData); + } + + uploadfilegetByIdfileupload_field(ref:any, Adv1:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`); + } + + + uploadfiledeletefileupload_field(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadfilefileupload_field2(ref:any, Adv1:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData); + } + + uploadfilegetByIdfileupload_field2(ref:any, Adv1:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`); + } + + + uploadfiledeletefileupload_field2(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadImageupload_field(ref:any, Adv1:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData); + } + + uploadImageupload_fieldgetById(ref:any, Adv1:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`); + } + + + uploadImageupload_fielddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadImageupload_field2(ref:any, Adv1:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData); + } + + uploadImageupload_field2getById(ref:any, Adv1:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`); + } + + + uploadImageupload_field2delete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadAudio_field(ref:any, Adv1:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData); + } + + uploadAudio_fieldgetById(ref:any, Adv1:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`); + } + + + uploadAudio_fielddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadAudio_field2(ref:any, Adv1:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData); + } + + uploadAudio_field2getById(ref:any, Adv1:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`); + } + + + uploadAudio_field2delete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadVideo_field(ref:any, Adv1:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData); + } + + uploadVideo_fieldgetById(ref:any, Adv1:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`); + } + + + uploadVideo_fielddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadVideo_field2(ref:any, Adv1:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData); + } + + uploadVideo_field2getById(ref:any, Adv1:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`); + } + + + uploadVideo_field2delete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1_cardvariable.ts new file mode 100644 index 0000000..8b2bd5c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv1/Adv1_cardvariable.ts @@ -0,0 +1,4 @@ +export const Adv1cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.html new file mode 100644 index 0000000..97e973b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.html @@ -0,0 +1,898 @@ + +
+
+
+

Adv3

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + + + + + + + country + + + + state + + + + stmlit + + + + stmmlt2 + + + + dy2 + + + + dy1 + + + + dymlti1 + + + + dymlt2 + + + + + + Action + + + + + + + + + + + +{{user.country }} + + +{{user.state }} + + +{{user.stmlit }} + + +{{user.stmmlt2 }} + + +{{user.dy2identifier}} + + +{{user.dy1identifier}} + + +{{user. dymlti1 }} + + +{{user. dymlt2 }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.ts new file mode 100644 index 0000000..cdc58c7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.component.ts @@ -0,0 +1,777 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Adv3service} from './Adv3.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Adv3cardvariable } from './Adv3_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Adv3', + templateUrl: './Adv3.component.html', + styleUrls: ['./Adv3.component.scss'] +}) +export class Adv3Component implements OnInit { + cardButton = Adv3cardvariable.cardButton; + cardmodeldata = Adv3cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Adv3cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Adv3_formCode' +tableName = 'Adv3'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Adv3service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + + + + + + +country : [null], + +state : [null], + +stmlit : [null], + +stmmlt2 : [null], + +dy2 : [null], + +dy1 : [null], + +dymlti1 : [null], + +dymlt2 : [null], + + + + + + + + + + + + + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Adv3_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + + + + + +this.getalldy2(); + + + + if (this.dy2default) { + // Listen for product changes to auto-fill description + + + + this.entryForm.get('dy2')?.valueChanges.subscribe(name => { + if (name && this.selectdy2) { + + const found = this.selectdy2.find(p => p.name === name); + + + + console.log('found is ', found); + + // Auto-fill price when product is selected + if (found && found.default_field) { + this.entryForm.patchValue({ default_field: found.default_field_link }); + } else { + this.entryForm.patchValue({ default_field: null }); + } + + } + }); +} + +this.getalldy1(); + + + + if (this.dy1default) { + // Listen for product changes to auto-fill description + + + + this.entryForm.get('dy1')?.valueChanges.subscribe(description => { + if (description && this.selectdy1) { + + const found = this.selectdy1.find(p => p.description === description); + + + + console.log('found is ', found); + + // Auto-fill price when product is selected + if (found && found.default_field) { + this.entryForm.patchValue({ default_field: found.default_field_link }); + } else { + this.entryForm.patchValue({ default_field: null }); + } + + } + }); +} + +this.getalldymlti1(); + +this.getalldymlt2(); + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + + + + + + + + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + +this.nodeEditPropertiesstmlit.editselectedAttributesstmlit = JSON.parse(this.rowSelected.stmlit ); + +this.nodeEditPropertiesstmmlt2.editselectedAttributesstmmlt2 = JSON.parse(this.rowSelected.stmmlt2 ); + + + + + +this.nodeEditPropertiesdymlti1.editselectedAttributesdymlti1 = JSON.parse(this.rowSelected.dymlti1 ); + +this.nodeEditPropertiesdymlt2.editselectedAttributesdymlt2 = JSON.parse(this.rowSelected.dymlt2 ); + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + + +this.rowSelected.stmlit = JSON.stringify(this.nodeEditPropertiesstmlit.editselectedAttributesstmlit ); + +this.rowSelected.stmmlt2 = JSON.stringify(this.nodeEditPropertiesstmmlt2.editselectedAttributesstmmlt2 ); + + + + + +this.rowSelected.dymlti1 = JSON.stringify(this.nodeEditPropertiesdymlti1.editselectedAttributesdymlti1 ); + +this.rowSelected.dymlt2 = JSON.stringify(this.nodeEditPropertiesdymlt2.editselectedAttributesdymlt2 ); + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + + +this.entryForm.value.stmlit = JSON.stringify(this.nodeEditPropertiesstmlit.addselectedAttributesstmlit ); + +this.entryForm.value.stmmlt2 = JSON.stringify(this.nodeEditPropertiesstmmlt2.addselectedAttributesstmmlt2 ); + + + + + +this.entryForm.value.dymlti1 = JSON.stringify(this.nodeEditPropertiesdymlti1.addselectedAttributesdymlti1 ); + +this.entryForm.value.dymlt2 = JSON.stringify(this.nodeEditPropertiesdymlt2.addselectedAttributesdymlt2 ); + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; this.getdatagrid_fieldData(); + + this.getdatagrid_field2Data(); + + + + + + + + + + + + + + + +this.nodeEditPropertiesdymlti1.addselectedAttributesdymlti1 = "" + +this.nodeEditPropertiesdymlt2.addselectedAttributesdymlt2 = "" + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} +//datagrid datagrid_field filed start +productdatagrid_field; + rowsdatagrid_field :any[]; + getHeadersdatagrid_field () { + this.rowsdatagrid_field = this.productdatagrid_field; + let headers: string[] = []; + if(this.rowsdatagrid_field ) { +this.rowsdatagrid_field.forEach((value) => { + Object.keys(value).forEach((key) => { + if(!headers.find((header) => header == key)){ + headers.push(key) + } + }) + }) +} + + return headers; + } + //datagrid datagrid_field filed end + +getdatagrid_fieldData() { + this.mainService.getdatagrid_fieldAll().subscribe((data) => { + console.log(data); this.productdatagrid_field = data; + }); +} + +//datagrid datagrid_field2 filed start +productdatagrid_field2; + rowsdatagrid_field2 :any[]; + getHeadersdatagrid_field2 () { + this.rowsdatagrid_field2 = this.productdatagrid_field2; + let headers: string[] = []; + if(this.rowsdatagrid_field2 ) { +this.rowsdatagrid_field2.forEach((value) => { + Object.keys(value).forEach((key) => { + if(!headers.find((header) => header == key)){ + headers.push(key) + } + }) + }) +} + + return headers; + } + //datagrid datagrid_field2 filed end + +getdatagrid_field2Data() { + this.mainService.getdatagrid_field2All().subscribe((data) => { + console.log(data); this.productdatagrid_field2 = data; + }); +} + + + + + + + +nodeEditPropertiesstmlit = { addselectedAttributesstmlit :"", editselectedAttributesstmlit :"" } + selectstmlit =[ + + + 'bihar', + + + + 'sikkim', + + + ]; + +nodeEditPropertiesstmmlt2 = { addselectedAttributesstmmlt2 :"", editselectedAttributesstmmlt2 :"" } + selectstmmlt2 =[ + + + 'p2', + + + + 'p3', + + + + 'ap', + + + ]; + +dy2default=false +selectdy2 ; +getalldy2() { + this.mainService.getAlldy2().subscribe(data=>{ +this.selectdy2 = data; +console.log(data); +},(error) => { console.log(error); }); } + + + + // ================== ORDER SUMMARY LOGIC START ================== + /** + * Order Summary Array and Methods for Add to Order functionality + */ + dy2Summary: any[] = []; + dy2total; +isdy2order =false; + /** + * Add selected product to order summary + */ + adddy2Order() { + const formValue = this.entryForm.value; + if (!formValue.dy2 ) { + this.toastr.error('Please select dy2'); + return; + } + // Get description from master (selectdy2) + + + + + if (this.selectdy2 && Array.isArray(this.selectdy2)) { + + + const found = this.selectdy2.find(p => p.name === formValue.dy2); + + + + + } + const line = this.dy2Summary.length + 1; + const orderItem = { + line: line, + + // unitPrice: Number(formValue.price), + // quantity: Number(formValue.quantity), + // total: Number(formValue.price) * Number(formValue.quantity) + }; + this.dy2Summary.push(orderItem); + + this.dy2total = ''; + } + + /** + * Remove item from order summary by index + */ + removedy2Order(index: number) { + this.dy2Summary.splice(index, 1); + // Recalculate line numbers + this.dy2Summary.forEach((item, i) => { + item.line = i + 1; + }); + } + + /** + * Calculate subtotal of all order items + */ + getdy2Subtotal(): number { + return this.dy2Summary.reduce((sum, item) => sum + item.total, 0); + } + + /** + * Calculate GST (18%) + */ + getdy2GST(): number { + return this.getdy2Subtotal() * 0.18; + } + + /** + * Calculate grand total (subtotal + GST) + */ + getdy2GrandTotal(): number { + return this.getdy2Subtotal() + this.getdy2GST(); + + } + // ================== ORDER SUMMARY LOGIC END ================== + + +dy1default=false +selectdy1 ; +getalldy1() { + this.mainService.getAlldy1().subscribe(data=>{ +this.selectdy1 = data; +console.log(data); +},(error) => { console.log(error); }); } + + + + // ================== ORDER SUMMARY LOGIC START ================== + /** + * Order Summary Array and Methods for Add to Order functionality + */ + dy1Summary: any[] = []; + dy1total; +isdy1order =false; + /** + * Add selected product to order summary + */ + adddy1Order() { + const formValue = this.entryForm.value; + if (!formValue.dy1 ) { + this.toastr.error('Please select dy1'); + return; + } + // Get description from master (selectdy1) + + + + + if (this.selectdy1 && Array.isArray(this.selectdy1)) { + + + const found = this.selectdy1.find(p => p.description === formValue.dy1); + + + + + } + const line = this.dy1Summary.length + 1; + const orderItem = { + line: line, + + // unitPrice: Number(formValue.price), + // quantity: Number(formValue.quantity), + // total: Number(formValue.price) * Number(formValue.quantity) + }; + this.dy1Summary.push(orderItem); + + this.dy1total = ''; + } + + /** + * Remove item from order summary by index + */ + removedy1Order(index: number) { + this.dy1Summary.splice(index, 1); + // Recalculate line numbers + this.dy1Summary.forEach((item, i) => { + item.line = i + 1; + }); + } + + /** + * Calculate subtotal of all order items + */ + getdy1Subtotal(): number { + return this.dy1Summary.reduce((sum, item) => sum + item.total, 0); + } + + /** + * Calculate GST (18%) + */ + getdy1GST(): number { + return this.getdy1Subtotal() * 0.18; + } + + /** + * Calculate grand total (subtotal + GST) + */ + getdy1GrandTotal(): number { + return this.getdy1Subtotal() + this.getdy1GST(); + + } + // ================== ORDER SUMMARY LOGIC END ================== + + +selectdymlti1; + getalldymlti1 () { + this.mainService.getAlldymlti1().subscribe(data=>{ + this.selectdymlti1 = data; + console.log(data); + },(error) => { console.log(error); }); } + nodeEditPropertiesdymlti1 = { addselectedAttributesdymlti1:"", editselectedAttributesdymlti1 :"" } + +selectdymlt2; + getalldymlt2 () { + this.mainService.getAlldymlt2().subscribe(data=>{ + this.selectdymlt2 = data; + console.log(data); + },(error) => { console.log(error); }); } + nodeEditPropertiesdymlt2 = { addselectedAttributesdymlt2:"", editselectedAttributesdymlt2 :"" } + +// updateaction +} + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.service.ts new file mode 100644 index 0000000..c497e6f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3.service.ts @@ -0,0 +1,63 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Adv3service{ + private baseURL = "Adv3/Adv3" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } +getdatagrid_fieldAll(page?: number, size?: number): Observable { + return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); + + } + +getdatagrid_field2All(page?: number, size?: number): Observable { + return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); + + } + + + + + + + + + + + +getAlldy2(): Observable { +return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +getAlldy1(): Observable { +return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +getAlldymlti1(): Observable { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +getAlldymlt2(): Observable { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3_cardvariable.ts new file mode 100644 index 0000000..8ed38af --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv3/Adv3_cardvariable.ts @@ -0,0 +1,4 @@ +export const Adv3cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.html new file mode 100644 index 0000000..b6b0aa5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.html @@ -0,0 +1,623 @@ + +
+
+
+

Adv4

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + atoc + + + + atc2 + + + + atdy1 + + + + atdy2 + + + + + + description + + + + name + + + + + + + active + + + + description + + + + name + + + + + + + Action + + + + + +{{user.atocidentifier}} + + +{{user.atc2identifier}} + + +{{user. atdy1 }} + + +{{user. atdy2 }} + + + + +{{user.support.description}} + + + +{{user.support.name}} + + + + + + +{{user.childform.active}} + + + +{{user.childform.description}} + + + +{{user.childform.name}} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.ts new file mode 100644 index 0000000..c6ba54c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.component.ts @@ -0,0 +1,395 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Adv4service} from './Adv4.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Adv4cardvariable } from './Adv4_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Adv4', + templateUrl: './Adv4.component.html', + styleUrls: ['./Adv4.component.scss'] +}) +export class Adv4Component implements OnInit { + cardButton = Adv4cardvariable.cardButton; + cardmodeldata = Adv4cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Adv4cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Adv4_formCode' +tableName = 'Adv4'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Adv4service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +atoc : [null], + +atc2 : [null], + +atdy1 : [null], + +atdy2 : [null], + +support: this.supportinitLinesForm(), + +childform: this.childforminitLinesForm(), + + + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Adv4_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end +this.getallatoc(); + +this.getallatc2(); + +this.getallatdy1(); + +this.getallatdy2(); + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + +supportinitLinesForm() { return this._fb.group({ + + + description: [null], + + + + name: [null], + + + +}); } + + + +childforminitLinesForm() { return this._fb.group({ + + + active: [null], + + + + description: [null], + + + + name: [null], + + + +}); } + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + +this.nodeEditPropertiesatdy1.editselectedAttributesatdy1 = JSON.parse(this.rowSelected.atdy1 ); + +this.nodeEditPropertiesatdy2.editselectedAttributesatdy2 = JSON.parse(this.rowSelected.atdy2 ); + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + +this.rowSelected.atdy1 = JSON.stringify(this.nodeEditPropertiesatdy1.editselectedAttributesatdy1 ); + +this.rowSelected.atdy2 = JSON.stringify(this.nodeEditPropertiesatdy2.editselectedAttributesatdy2 ); + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + +this.entryForm.value.atdy1 = JSON.stringify(this.nodeEditPropertiesatdy1.addselectedAttributesatdy1 ); + +this.entryForm.value.atdy2 = JSON.stringify(this.nodeEditPropertiesatdy2.addselectedAttributesatdy2 ); + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + +this.nodeEditPropertiesatdy1.addselectedAttributesatdy1 = "" + +this.nodeEditPropertiesatdy2.addselectedAttributesatdy2 = "" + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} +selectatoc ; + getallatoc () { + this.mainService.getAllatoc().subscribe(data=>{ + this.selectatoc = data; console.log(data); + },(error) => { console.log(error); }); } + +selectatc2 ; + getallatc2 () { + this.mainService.getAllatc2().subscribe(data=>{ + this.selectatc2 = data; console.log(data); + },(error) => { console.log(error); }); } + +selectatdy1; + getallatdy1 () { + this.mainService.getAllatdy1().subscribe(data=>{ + this.selectatdy1 = data; + console.log(data); + },(error) => { console.log(error); }); } + nodeEditPropertiesatdy1 = { addselectedAttributesatdy1:"", editselectedAttributesatdy1 :"" } + +selectatdy2; + getallatdy2 () { + this.mainService.getAllatdy2().subscribe(data=>{ + this.selectatdy2 = data; + console.log(data); + },(error) => { console.log(error); }); } + nodeEditPropertiesatdy2 = { addselectedAttributesatdy2:"", editselectedAttributesatdy2 :"" } + + + + + +// updateaction +} + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.service.ts new file mode 100644 index 0000000..fd55127 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4.service.ts @@ -0,0 +1,45 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Adv4service{ + private baseURL = "Adv4/Adv4" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } +getAllatoc(): Observable { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +getAllatc2(): Observable { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +getAllatdy1(): Observable { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +getAllatdy2(): Observable { return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4_cardvariable.ts new file mode 100644 index 0000000..bee29d9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv4/Adv4_cardvariable.ts @@ -0,0 +1,4 @@ +export const Adv4cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.html new file mode 100644 index 0000000..88fba21 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.html @@ -0,0 +1,787 @@ + +
+
+
+

Adv5

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + + + age + + + + age2 + + + + + + + + + + + + + + + + Action + + + + + +{{user.name }} + + + + +{{user.age }} + + +{{user.age2 }} + + + + + + + + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.ts new file mode 100644 index 0000000..93aecb3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.component.ts @@ -0,0 +1,851 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Adv5service} from './Adv5.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Adv5cardvariable } from './Adv5_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Adv5', + templateUrl: './Adv5.component.html', + styleUrls: ['./Adv5.component.scss'] +}) +export class Adv5Component implements OnInit { + cardButton = Adv5cardvariable.cardButton; + cardmodeldata = Adv5cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Adv5cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Adv5_formCode' +tableName = 'Adv5'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Adv5service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + +support: this._fb.array([this.initsupportForm()]), + +age : [null,[Validators.required]], + +age2 : [null,[Validators.required]], + + + + + + + + + +childform: this._fb.array([this.initchildformForm()]), + + + + + + + + + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Adv5_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + // Subscribe to value changes for auto calculation + this.entryForm.valueChanges.subscribe(() => { + this.onInputChangeaddition('add'); + }); + +// Start polling for edit changes + this.editInterval = setInterval(() => { + if (this.modalEdit) { + this.onInputChangeaddition('edit'); + } + }, 200); + + // Subscribe to value changes for auto calculation + this.entryForm.valueChanges.subscribe(() => { + this.onInputChangemultiplication('add'); + }); + +// Start polling for edit changes + this.editInterval = setInterval(() => { + if (this.modalEdit) { + this.onInputChangemultiplication('edit'); + } + }, 200); + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + +// one to many start + initsupportForm() { return this._fb.group({ + + + + description: [null], + + + + name: [null], + + + +}); } +get supportcontrols() {return (this.entryForm.get("support") as FormArray).controls; } +onAddsupport() { +(this.entryForm.get("support")).push(this.initsupportForm()); } +onRemovesupport(index: number) { +(this.entryForm.get("support")).removeAt(index); } + oneditsupport() { this.supportcomponents.push({ + + +description: "", + + + +name: "", + + + + }); } + deletesupportRow(index) { + this.supportcomponents.splice(index, 1); + } +supportcomponents; + // one to many end + + + + + + + + + + + + + +// one to many start + initchildformForm() { return this._fb.group({ + + + + active: [null], + + + + description: [null], + + + + name: [null], + + + +}); } +get childformcontrols() {return (this.entryForm.get("childform") as FormArray).controls; } +onAddchildform() { +(this.entryForm.get("childform")).push(this.initchildformForm()); } +onRemovechildform(index: number) { +(this.entryForm.get("childform")).removeAt(index); } + oneditchildform() { this.childformcomponents.push({ + + +active: "", + + + +description: "", + + + +name: "", + + + + }); } + deletechildformRow(index) { + this.childformcomponents.splice(index, 1); + } +childformcomponents; + // one to many end + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + +this.supportcomponents = row.support; + + + + + + + + + + + + + +this.childformcomponents = row.childform; + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + +//calculated field start + +this.onInputChangeaddition ('edit'); + //calculated field end + +//calculated field start + +this.onInputChangemultiplication ('edit'); + //calculated field end + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + + + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + + + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + + + + + + + + + // calculated field code start + + + + additionage; + + + + additionage2; + + + + additiontotal; + additioncalculateOperators: 'Addition' | 'Subtraction' | 'Multiplication' | 'Division' | 'Concatination' = "Addition" + onInputChangeaddition(mode: 'add' | 'edit') { + + + const lastObj = 0 + const lastObjstring = '' + if (mode === 'add') { + + + this.additionage = this.entryForm.value.age || ''; + + + + this.additionage2 = this.entryForm.value.age2 || ''; + + + + } else { + + + this.additionage = this.rowSelected.age; + + + + this.additionage2 = this.rowSelected.age2; + + + } + + + const ageValue = parseFloat(this.additionage) || 0; + + + + const age2Value = parseFloat(this.additionage2) || 0; + + + switch (this.additioncalculateOperators) { + case 'Addition': + this.additiontotal = ( + + + ageValue + + + + + age2Value + + + + lastObj).toString(); + break; + case 'Subtraction': + this.additiontotal = ( + + + ageValue - + + + + age2Value - + + + lastObj).toString(); + break; + case 'Multiplication': + this.additiontotal = ( + + + ageValue * + + + + age2Value * + + + 1).toString(); + + break; + case 'Division': + + this.additiontotal = ( + + + ageValue / + + + + age2Value / + + + 1).toString(); + + break; + case 'Concatination': + this.additiontotal = ` + + + ${this.additionage || ''} + + + + ${this.additionage2 || ''} + + + ${lastObjstring || ''}`; + + break; + default: + this.additiontotal = ''; + } + } + + + + // calculated field code start + + + + multiplicationage; + + + + multiplicationage2; + + + + multiplicationtotal; + multiplicationcalculateOperators: 'Addition' | 'Subtraction' | 'Multiplication' | 'Division' | 'Concatination' = "Multiplication" + onInputChangemultiplication(mode: 'add' | 'edit') { + + + const lastObj = 0 + const lastObjstring = '' + if (mode === 'add') { + + + this.multiplicationage = this.entryForm.value.age || ''; + + + + this.multiplicationage2 = this.entryForm.value.age2 || ''; + + + + } else { + + + this.multiplicationage = this.rowSelected.age; + + + + this.multiplicationage2 = this.rowSelected.age2; + + + } + + + const ageValue = parseFloat(this.multiplicationage) || 0; + + + + const age2Value = parseFloat(this.multiplicationage2) || 0; + + + switch (this.multiplicationcalculateOperators) { + case 'Addition': + this.multiplicationtotal = ( + + + ageValue + + + + + age2Value + + + + lastObj).toString(); + break; + case 'Subtraction': + this.multiplicationtotal = ( + + + ageValue - + + + + age2Value - + + + lastObj).toString(); + break; + case 'Multiplication': + this.multiplicationtotal = ( + + + ageValue * + + + + age2Value * + + + 1).toString(); + + break; + case 'Division': + + this.multiplicationtotal = ( + + + ageValue / + + + + age2Value / + + + 1).toString(); + + break; + case 'Concatination': + this.multiplicationtotal = ` + + + ${this.multiplicationage || ''} + + + + ${this.multiplicationage2 || ''} + + + ${lastObjstring || ''}`; + + break; + default: + this.multiplicationtotal = ''; + } + } + + +//Value List field start +value_list_fieldMode; +searchcusttextvalue_list_field :any; + valueListModalvalue_list_field :boolean=false; + openvalueListvalue_list_field(mode){ + this.valueListModalvalue_list_field=!this.valueListModalvalue_list_field ; + this.value_list_fieldMode = mode; } + customerdatavalue_list_field ; +value_list_fielderror; +clickedvalue_list_fieldID:number; + +getcustvalue_list_fieldID(id:number){ + this.clickedvalue_list_fieldID=id; + console.log("clicked by id"+ id); + this.mainService.getById(id).subscribe((data) => { console.log(data); + if(this.value_list_fieldMode == "ADD"){ + + + + this.entryForm.get('age').setValue(data.age); + + + + }else if(this.value_list_fieldMode == "EDIT"){ + + + + this.rowSelected.age= data. age + + + + } }); this.valueListModalvalue_list_field =false; + } //value List field end + +//Value List field start +value_list_field2Mode; +searchcusttextvalue_list_field2 :any; + valueListModalvalue_list_field2 :boolean=false; + openvalueListvalue_list_field2(mode){ + this.valueListModalvalue_list_field2=!this.valueListModalvalue_list_field2 ; + this.value_list_field2Mode = mode; } + customerdatavalue_list_field2 ; +value_list_field2error; +clickedvalue_list_field2ID:number; + +getcustvalue_list_field2ID(id:number){ + this.clickedvalue_list_field2ID=id; + console.log("clicked by id"+ id); + this.mainService.getById(id).subscribe((data) => { console.log(data); + if(this.value_list_field2Mode == "ADD"){ + + + + this.entryForm.get('name').setValue(data.name); + + + + this.entryForm.get('age2').setValue(data.age2); + + + + this.entryForm.get('age').setValue(data.age); + + + + }else if(this.value_list_field2Mode == "EDIT"){ + + + + this.rowSelected.name= data. name + + + + this.rowSelected.age2= data. age2 + + + + this.rowSelected.age= data. age + + + + } }); this.valueListModalvalue_list_field2 =false; + } //value List field end + + + +// updateaction +} + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.service.ts new file mode 100644 index 0000000..814350a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5.service.ts @@ -0,0 +1,51 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Adv5service{ + private baseURL = "Adv5/Adv5" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5_cardvariable.ts new file mode 100644 index 0000000..e55c622 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Adv5/Adv5_cardvariable.ts @@ -0,0 +1,4 @@ +export const Adv5cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.html new file mode 100644 index 0000000..23d9e67 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.html @@ -0,0 +1,682 @@ + +
+
+
+

Basicp1

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + name + + + + name2 + + + + number1 + + + + number2 + + + + Phone Number + + + + Phone Number2 + + + + Paragraph + Field + + + + Paragraph + Field2 + + + + Password + Field + + + + Textarea + + + + Textarea + Field + + + + Textarea + Field2 + + + + + + Action + + + + + + {{user.name }} + + + {{user.name2 }} + + + {{user.number1 }} + + + {{user.number2 }} + + + {{user.phone_number }} + + + {{user.phone_number2 }} + + + + + + + + + {{user.password_field }} + + + + + + + + + + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview +
+
+
+
+
+
+
+
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.scss new file mode 100644 index 0000000..fbdee86 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.scss @@ -0,0 +1,1079 @@ +//@import "../../../../assets/scss/var"; + +// Import the field types styles +@import '../../../../../shared/components/field-types/field-types.scss'; + +@import '../../../../../../styles.scss'; + +// Import design tokens +@import '../../../../../../styles/design-tokens'; + +// User Group Maintenance Styles +.ug-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + font-family: var(--theme-font-primary); + + &__content { + display: flex; + align-items: center; + gap: 16px; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 16px; + display: flex; + align-items: center; + justify-content: center; + + clr-icon { + width: 36px; + height: 36px; + color: white; + } + } + + &__title { + font-size: 28px; + font-weight: 700; + margin: 0; + color: white; + font-family: var(--theme-font-secondary); + } + + &__subtitle { + font-size: 16px; + margin: 0; + opacity: 0.9; + color: rgba(255, 255, 255, 0.8); + } + + &__actions { + display: flex; + gap: 12px; + } +} + +.ug-btn-text { + margin-left: 8px; +} + +// Modern Button Styles using ThemeService +.ug-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + font-size: 14px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; + + &:focus { + outline: 2px solid var(--theme-primary); + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + // Sizes + &.ug-btn-sm { + padding: 8px 16px; + font-size: 13px; + height: 32px; + } + + &.ug-btn-md { + padding: 12px 20px; + font-size: 14px; + height: 40px; + } + + &.ug-btn-lg { + padding: 16px 24px; + font-size: 16px; + height: 48px; + } + + // Variants + &.ug-btn-primary { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-color: var(--theme-primary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: linear-gradient(135deg, var(--theme-primary, #0284c7) 0%, var(--theme-accent, #7c3aed) 100%); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + + &:active { + transform: translateY(0); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + } + + &.ug-btn-secondary { + background: var(--theme-surface); + color: var(--theme-text); + border-color: rgba(0, 0, 0, 0.1); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-background); + border-color: rgba(0, 0, 0, 0.2); + transform: translateY(-1px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.ug-btn-outline { + background: transparent; + color: var(--theme-secondary); + border-color: var(--theme-secondary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: rgba(100, 116, 139, 0.1); // var(--theme-secondary) with 10% opacity + border-color: var(--theme-secondary); + color: var(--theme-secondary); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.ug-btn-error { + background: var(--theme-error, #ef4444); + color: white; + border-color: var(--theme-error, #ef4444); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.1); + } + } + + &.ug-btn-ghost { + background: transparent; + color: var(--theme-text-secondary); + border-color: transparent; + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } + } +} + +.ug-toolbar { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + padding: 16px; + background: var(--theme-surface); + border-radius: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &__left { + flex: 1; + } + + &__right { + display: flex; + gap: 8px; + } +} + +.ug-search { + position: relative; + max-width: 400px; + + clr-icon { + position: absolute; + left: 12px; + top: 50%; + transform: translateY(-50%); + color: #9ca3af; + z-index: 1; + } + + &__input { + width: 100%; + padding: 12px 12px 12px 40px; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + font-size: 14px; + transition: all 200ms ease-out; + background: var(--theme-surface); + color: var(--theme-text); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); // var(--theme-primary) with 10% opacity + } + } +} + +.ug-view-toggle { + display: flex; + border: 1px solid #d1d5db; + border-radius: 8px; + overflow: hidden; + + .ug-btn { + border-radius: 0; + border: none; + background: var(--theme-surface); + color: var(--theme-text-secondary); + + &:first-child { + border-right: 1px solid #d1d5db; + } + + &.ug-btn-primary { + background: var(--theme-primary); + color: white; + } + } +} + +// Modern Table Styles +.ug-grid { + background: var(--theme-surface); + border-radius: 16px; + overflow: hidden; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + + ::ng-deep .datagrid { + .datagrid-head { + background: var(--theme-background); + + .datagrid-column { + padding: 16px 24px; + font-size: 12px; + font-weight: 600; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid #e5e7eb; + } + } + + .datagrid-row { + transition: background-color 150ms ease-out; + + &:hover { + background: var(--theme-background); + } + + &:not(:last-child) { + border-bottom: 1px solid #e5e7eb; + } + + .datagrid-cell { + padding: 16px 24px; + font-size: 14px; + color: var(--theme-text); + } + } + + .datagrid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; + padding: 16px 24px; + } + } +} + +.ug-grid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; +} + +// Modern Card Styles - More beautiful design +.ug-cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); + gap: 24px; + margin-bottom: 24px; +} + +.ug-card-item { + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.06); + border-radius: var(--theme-border-radius); // Using theme variable + box-shadow: var(--theme-shadow); // Using theme variable + overflow: hidden; + display: flex; + flex-direction: column; + transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); + + &:hover { + transform: translateY(-5px); + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); + border-color: rgba(14, 165, 233, 0.3); // var(--theme-primary) with 30% opacity + } + + &__header { + display: flex; + align-items: center; + gap: 10px; + padding: 16px; + background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), transparent); // var(--theme-primary) with 10% opacity + min-height: 60px; + } + + &__icon { + clr-icon { + width: 24px; + height: 24px; + color: var(--theme-primary); + } + } + + &__title { + font-weight: 700; + flex: 1 1 auto; + font-size: 18px; + color: var(--theme-text); + max-width: 60%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + &__badge { + margin-left: auto; + display: inline-flex; + align-items: center; + padding: 4px 12px; + font-size: 12px; + font-weight: 600; + border-radius: 9999px; + text-transform: uppercase; + letter-spacing: 0.05em; + } + + &__body { + padding: 16px; + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px; + } + + &__footer { + padding: 16px; + display: flex; + gap: 8px; + border-top: 1px solid rgba(0, 0, 0, 0.06); + background: var(--theme-background); + } +} + +.ug-kv { + display: flex; + justify-content: space-between; + font-size: 14px; + + span { + color: var(--theme-text-secondary); + } + + strong { + color: var(--theme-text); + font-weight: 500; + text-align: right; + max-width: 60%; + overflow: hidden; + text-overflow: ellipsis; + } +} + +// Theme the card footer buttons +.ug-card-item__footer .ug-btn { + border-radius: 10px; + flex: 1; + justify-content: center; +} + +.ug-card-item__footer .ug-btn.ug-btn-outline { + border: 1px solid var(--theme-secondary); + color: var(--theme-secondary); + background: transparent; + + &:hover { + background: rgba(100, 116, 139, 0.1); // var(--theme-secondary) with 10% opacity + border-color: var(--theme-secondary); + color: var(--theme-secondary); + } +} + +.ug-card-item__footer .ug-btn.ug-btn-error { + background: var(--theme-error, #ef4444); + color: #fff; + border-color: var(--theme-error, #ef4444); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + } +} + +// Table view action buttons +.ug-action-item { + @extend .ug-btn; + @extend .ug-btn-ghost; + @extend .ug-btn-sm; + width: 100%; + justify-content: flex-start; + margin-bottom: 4px; + text-align: left; + + clr-icon { + width: 16px; + height: 16px; + margin-right: 8px; + } + + &.ug-btn-error { + color: var(--theme-error, #ef4444); + + &:hover { + background: rgba(239, 68, 68, 0.1); + } + } +} + +// Ensure action overflow is visible +::ng-deep .datagrid-action-overflow { + button.action-item { + display: flex; + align-items: center; + width: 100%; + text-align: left; + padding: 8px 12px; + + clr-icon { + margin-right: 8px; + } + } +} + +// Status Badges +.ug-status-badge { + display: inline-flex; + align-items: center; + padding: 6px 16px; + font-size: 13px; + font-weight: 600; + border-radius: 9999px; + text-transform: uppercase; + letter-spacing: 0.05em; +} + +.ug-status-enabled { + background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%); + color: #10b981; +} + +.ug-status-disabled { + background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%); + color: #ef4444; +} + +// Form Styles +.ug-form-group { + margin-bottom: 20px; +} + +.ug-form-label { + display: block; + font-size: 14px; + font-weight: 500; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); +} + +.ug-form-input, +.ug-form-select { + width: 100%; + padding: 12px 16px; + font-size: 14px; + line-height: 1.5; + color: var(--theme-text); + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + transition: all 200ms ease-out; + margin-bottom: 0; + font-family: var(--theme-font-primary); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); // var(--theme-primary) with 10% opacity + } + + &:disabled { + background: var(--theme-background); + color: var(--theme-text-secondary); + cursor: not-allowed; + } + + &.error { + border-color: #ef4444; + box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); + } + + &::placeholder { + color: var(--theme-text-secondary); + } +} + +.ug-form-select { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e"); + background-position: right 12px center; + background-repeat: no-repeat; + background-size: 16px 12px; + padding-right: 40px; + appearance: none; +} + +.ug-form-error { + color: #ef4444; + font-size: 12px; + margin-top: 6px; + font-weight: 500; +} + +.required-field { + color: #ef4444; + margin-left: 4px; +} + +.ug-file-input { + width: 100%; + padding: 12px; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + background: var(--theme-surface); + color: var(--theme-text); + + &::file-selector-button { + @extend .ug-btn; + @extend .ug-btn-secondary; + margin-right: 12px; + padding: 8px 16px; + border: none; + } +} + +// Delete Modal Styles +.ug-delete-header { + text-align: center; + padding: 24px; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.ug-delete-icon { + color: #ef4444; + margin-bottom: 16px; +} + +.ug-delete-title { + font-size: 24px; + font-weight: 700; + color: var(--theme-text); + margin: 0 0 8px 0; +} + +.ug-delete-subtitle { + font-size: 16px; + color: var(--theme-text-secondary); + margin: 0; +} + +.ug-delete-details { + padding: 24px; +} + +.ug-delete-detail-item { + display: flex; + justify-content: space-between; + padding: 12px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + + &:last-child { + border-bottom: none; + } +} + +.ug-delete-detail-label { + font-weight: 500; + color: var(--theme-text-secondary); +} + +.ug-delete-detail-value { + font-weight: 600; + color: var(--theme-text); +} + +.delete { + color: #ef4444; + text-align: center; + margin-bottom: 16px; + font-weight: 600; + font-size: 20px; +} + +.heading { + text-align: center; + margin-bottom: 24px; + color: var(--theme-text); + font-weight: 600; +} + +// Modal Header +::ng-deep .modal-header { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px 16px 0 0 !important; + padding: 20px 24px !important; + + .modal-title { + color: white; + font-weight: 600; + font-size: 20px; + margin: 0; + } + + .close { + color: white; + opacity: 0.8; + + &:hover { + opacity: 1; + } + } +} + +// Modal Body +::ng-deep .modal-body { + padding: 24px !important; +} + +// Modal Footer +::ng-deep .modal-footer { + padding: 20px 24px !important; + background: var(--theme-background); + border-radius: 0 0 16px 16px !important; + border-top: 1px solid rgba(0, 0, 0, 0.05) !important; +} + +// Responsive adjustments +@media (max-width: 768px) { + .ug-hero { + flex-direction: column; + gap: 16px; + text-align: center; + + &__content { + flex-direction: column; + text-align: center; + } + + &__actions { + width: 100%; + justify-content: center; + flex-wrap: wrap; + } + } + + .ug-toolbar { + flex-direction: column; + gap: 16px; + } + + .ug-search { + max-width: 100%; + } + + .ug-cards { + grid-template-columns: 1fr; + } + + .ug-card-item { + &__header { + flex-direction: column; + text-align: center; + + &__icon { + margin-right: 0; + margin-bottom: 16px; + } + } + + &__footer { + justify-content: center; + } + } +} + +// Hero section +.sq-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + font-family: var(--theme-font-primary); + + &__content { + display: flex; + align-items: center; + gap: 16px; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 16px; + display: flex; + align-items: center; + justify-content: center; + + clr-icon { + width: 36px; + height: 36px; + color: white; + } + } + + &__title { + font-size: 28px; + font-weight: 700; + margin: 0; + color: white; + font-family: var(--theme-font-secondary); + } + + &__subtitle { + font-size: 16px; + margin: 0; + opacity: 0.9; + color: rgba(255, 255, 255, 0.8); + } + + &__actions { + display: flex; + align-items: center; + gap: 12px; + } +} + +.sq-container { + background: var(--theme-surface); + border-radius: 16px; + padding: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; +} + +.delete, +.heading { + text-align: center; + color: var(--theme-error, #ef4444); +} + +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} + +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: var(--theme-background, #dddddd); + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.center { + text-align: center; +} + +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: var(--theme-primary, #1a237e); + letter-spacing: 0.5px; + font-size: 1.25rem; +} + +// Modal Styles +.sq-modal-title clr-icon { + margin-right: 6px; + color: var(--theme-primary); +} + +// Delete Modal Styles +.sq-delete-header { + text-align: center; + padding: 24px; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.sq-delete-icon { + color: var(--theme-error, #ef4444); + margin-bottom: 16px; +} + +.sq-delete-title { + font-size: 24px; + font-weight: 700; + color: var(--theme-text); + margin: 0 0 8px 0; +} + +.sq-delete-subtitle { + font-size: 16px; + color: var(--theme-text-secondary); + margin: 0; +} + +.sq-delete-details { + padding: 24px; +} + +.sq-delete-detail-item { + display: flex; + justify-content: space-between; + padding: 12px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + + &:last-child { + border-bottom: none; + } +} + +.sq-delete-detail-label { + font-weight: 500; + color: var(--theme-text-secondary); +} + +.sq-delete-detail-value { + font-weight: 600; + color: var(--theme-text); +} + +// Data Grid Styles +.sq-grid { + background: var(--theme-surface); + border-radius: 16px; + overflow: hidden; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + + ::ng-deep .datagrid { + .datagrid-head { + background: var(--theme-background); + + .datagrid-column { + padding: 16px 24px; + font-size: 12px; + font-weight: 600; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid #e5e7eb; + } + } + + .datagrid-row { + transition: background-color 150ms ease-out; + + &:hover { + background: var(--theme-background); + } + + &:not(:last-child) { + border-bottom: 1px solid #e5e7eb; + } + + .datagrid-cell { + padding: 16px 24px; + font-size: 14px; + color: var(--theme-text); + } + } + + .datagrid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; + padding: 16px 24px; + } + } +} + +.sq-grid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; +} + +// Action items in datagrid - using direct styles instead of extend +.sq-action-item { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 8px 16px; + font-size: 13px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; + width: 100%; + justify-content: flex-start; + margin-bottom: 4px; + text-align: left; + background: transparent; + color: var(--theme-text-secondary); + border-color: transparent; + + &:focus { + outline: 2px solid var(--theme-primary); + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + clr-icon { + width: 16px; + height: 16px; + margin-right: 8px; + } + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } + + &.sq-btn-error { + color: var(--theme-error, #ef4444); + + &:hover { + background: rgba(239, 68, 68, 0.1); + color: var(--theme-error, #ef4444); + } + } +} + +// Form Styles +.sq-form { + .clr-row { + margin: 0 -12px; + } + + .clr-col-md-6, + .clr-col-sm-12 { + padding: 0 12px; + margin-bottom: 20px; + } +} + +.sq-form-actions { + display: flex; + gap: 12px; + margin-top: 24px; + padding-top: 24px; + border-top: 1px solid rgba(0, 0, 0, 0.05); +} + +// Responsive adjustments +@media (max-width: 768px) { + .sq-hero { + flex-direction: column; + gap: 16px; + text-align: center; + + &__content { + flex-direction: column; + text-align: center; + } + + &__actions { + width: 100%; + justify-content: center; + } + } + + .sq-form-actions { + flex-direction: column; + } + + .sq-btn { + width: 100%; + justify-content: center; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.ts new file mode 100644 index 0000000..6cd06c2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.component.ts @@ -0,0 +1,510 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Basicp1service } from './Basicp1.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Basicp1cardvariable } from './Basicp1_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Basicp1', + templateUrl: './Basicp1.component.html', + styleUrls: ['./Basicp1.component.scss'] +}) +export class Basicp1Component implements OnInit { + cardButton = Basicp1cardvariable.cardButton; + cardmodeldata = Basicp1cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Basicp1cardvariable.cardButton; + cardmodal; changeView() { + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine: any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Basicp1_formCode' + tableName = 'Basicp1'; checkFormCode; selected: any[] = []; + constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Basicp1service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; + // component button + ngOnInit(): void { + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + name: [null], + + name2: [null], + + number1: [null, [Validators.required]], + + number2: [null, [Validators.required]], + + phone_number: ['+91'], + + phone_number2: ['+91'], + + paragraph_field: [null], + + paragraph_field2: [null], + + password_field: [null], + confirmpassword_field: [null], + + textarea: [null], + + textarea_field: [null], + + textarea_field2: [null], + + + + + }, { + validator: Confirmedpassword_fieldValidator('password_field', 'confirmpassword_field') + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Basicp1_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + + + + + + + + + + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; + this.product = [...this.product].reverse(); if (this.product.length == 0) { + this.error = "No Data Available" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + + + + + + + + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + + + + + + + + + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + + + + + + + + + + + + + + + + + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; this.submitted = false; + + + + + + + + + + + + + + + + + + + + + + + + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + + + + + + + + isValidPhone_number(phone: string): boolean { + const phonePattern = /^(\+[1-9][0-9]{0,2})?[1-9][0-9]{9}$/; + return phonePattern.test(phone); + } + + isValidPhone_number2(phone: string): boolean { + const phonePattern = /^(\+[1-9][0-9]{0,2})?[1-9][0-9]{9}$/; + return phonePattern.test(phone); + } + + rsModalparagraph_field = false; + goToReplaceStringparagraph_field(row) { + this.rowSelected = row; this.rsModalparagraph_field = true; + } + + rsModalparagraph_field2 = false; + goToReplaceStringparagraph_field2(row) { + this.rowSelected = row; this.rsModalparagraph_field2 = true; + } + + newpHidepassword_field: boolean = true; + newIconpassword_field: string = "eye"; + newShapeChangerpassword_field() { + this.newpHidepassword_field = !this.newpHidepassword_field; + if (this.newpHidepassword_field) { + this.newIconpassword_field = 'eye' + } else { this.newIconpassword_field = 'eye-hide' } + } + + newaddpHidepassword_field: boolean = true; + newaddIconpassword_field: string = "eye"; + newaddChangerpassword_field() { + this.newaddpHidepassword_field = !this.newaddpHidepassword_field; + if (this.newaddpHidepassword_field) { this.newaddIconpassword_field = 'eye' } else { + this.newaddIconpassword_field = 'eye-hide' + } + } + + rsModaltextarea = false; + goToReplaceStringtextarea(row) { + this.rowSelected = row; this.rsModaltextarea = true; + } + + rsModaltextarea_field = false; + goToReplaceStringtextarea_field(row) { + this.rowSelected = row; this.rsModaltextarea_field = true; + } + + rsModaltextarea_field2 = false; + goToReplaceStringtextarea_field2(row) { + this.rowSelected = row; this.rsModaltextarea_field2 = true; + } + + // updateaction +} + + + + + + + + + + + + + + + +export function Confirmedpassword_fieldValidator(controlName: string, matchingControlName: string) { + return (formGroup: FormGroup) => { + const control = formGroup.controls[controlName]; + const matchingControl = formGroup.controls[matchingControlName]; + if (matchingControl.errors && !matchingControl.errors.confirmedpassword_fieldValidator) { + return; + } + if (control.value !== matchingControl.value) { + matchingControl.setErrors({ confirmedpassword_fieldValidator: true }); + } else { + matchingControl.setErrors(null); + } + } +} + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.service.ts new file mode 100644 index 0000000..4258bf3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1.service.ts @@ -0,0 +1,57 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Basicp1service{ + private baseURL = "Basicp1/Basicp1" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + + + + + + + + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1_cardvariable.ts new file mode 100644 index 0000000..69dfa6e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp1/Basicp1_cardvariable.ts @@ -0,0 +1,4 @@ +export const Basicp1cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.html new file mode 100644 index 0000000..9fdc3e8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.html @@ -0,0 +1,560 @@ + +
+
+
+

Basicp2

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + about + + + + Textarea2 + + + + Date Field + + + + Date Field2 + + + + Datetime Field + + + + Datetime Field2 + + + + Email Field + + + + Email Field2 + + + + + + + + Action + + + + + + + + + + + + + +{{user.date_field }} + + +{{user.date_field2 }} + + +{{user.datetime_field }} + + +{{user.datetime_field2 }} + + +{{user.email_field }} + + +{{user.email_field2 }} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.ts new file mode 100644 index 0000000..bb0c699 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.component.ts @@ -0,0 +1,425 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Basicp2service} from './Basicp2.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Basicp2cardvariable } from './Basicp2_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Basicp2', + templateUrl: './Basicp2.component.html', + styleUrls: ['./Basicp2.component.scss'] +}) +export class Basicp2Component implements OnInit { + cardButton = Basicp2cardvariable.cardButton; + cardmodeldata = Basicp2cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Basicp2cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Basicp2_formCode' +tableName = 'Basicp2'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Basicp2service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +about : [null], + +textarea2 : [null], + +date_field : [null], + +date_field2 : [null], + +datetime_field : [null], + +datetime_field2 : [null], + +email_field : [null], + +email_field2 : [null], + + + + + + + + + + + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Basicp2_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + + + + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + + + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + + + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + + + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} +rsModalabout = false; +goToReplaceStringabout(row){ +this.rowSelected = row; this.rsModalabout =true; } + +rsModaltextarea2 = false; +goToReplaceStringtextarea2(row){ +this.rowSelected = row; this.rsModaltextarea2 =true; } + + + + + + + + + +isValidemail_field(email: string): boolean { + const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; + return emailPattern.test(email); } + +isValidemail_field2(email: string): boolean { + const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; + return emailPattern.test(email); } + + + +// updateaction +} + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.service.ts new file mode 100644 index 0000000..dfd7233 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2.service.ts @@ -0,0 +1,51 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Basicp2service{ + private baseURL = "Basicp2/Basicp2" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2_cardvariable.ts new file mode 100644 index 0000000..48d7ae9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp2/Basicp2_cardvariable.ts @@ -0,0 +1,4 @@ +export const Basicp2cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.html new file mode 100644 index 0000000..5d03ef2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.html @@ -0,0 +1,627 @@ + +
+
+
+

Basicp3

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Toggle Switch + + + + Toggle Switch2 + + + + Url Field + + + + Url Field2 + + + + Decimal Field + + + + Decimal Field2 + + + + Percentage Field + + + + Percentage Field2 + + + + documentsequenc + + + + recaptcha + + + + recaptcha2 + + + + + + Action + + + + + +{{user.toggle_switch }} + + +{{user.toggle_switch2 }} + + +{{user.url_field}} + + +{{user.url_field2}} + + +{{user.decimal_field }} + + +{{user.decimal_field2 }} + + +{{user.percentage_field }} + + +{{user.percentage_field2 }} + + +{{user.documentsequenc }} + + +{{user.recaptcha }} + + +{{user.recaptcha2 }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.ts new file mode 100644 index 0000000..41b9c71 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.component.ts @@ -0,0 +1,517 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Basicp3service} from './Basicp3.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Basicp3cardvariable } from './Basicp3_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Basicp3', + templateUrl: './Basicp3.component.html', + styleUrls: ['./Basicp3.component.scss'] +}) +export class Basicp3Component implements OnInit { + cardButton = Basicp3cardvariable.cardButton; + cardmodeldata = Basicp3cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Basicp3cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Basicp3_formCode' +tableName = 'Basicp3'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Basicp3service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +toggle_switch : [true], + +toggle_switch2 : [true], + +url_field : [null], + +url_field2 : [null], + +decimal_field : [null,[Validators.required]], + +decimal_field2 : [null,[Validators.required]], + +percentage_field : [null,[Validators.required]], + +percentage_field2 : [null,[Validators.required]], + +documentsequenc : [null], + +recaptcha : ['', [Validators.required,this.checkrecaptcha.bind(this)]], + +recaptcha2 : ['', [Validators.required,this.checkrecaptcha2.bind(this)]], + + + + + + + + + + + + + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Basicp3_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + + + + + + + + + +this.generaterecaptcha() + +this.generaterecaptcha2() + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + + + + + + + + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + + + + + + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + + + + + + + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + + + + + + + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + + + + + + + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + + + +isValidurl_field(url: string): boolean { + return /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/.test(url); } + goTourl_fieldUrl(val){ window.open(val) } + +isValidurl_field2(url: string): boolean { + return /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/.test(url); } + goTourl_field2Url(val){ window.open(val) } + + + + + + + + + + + +recaptchaCode = ''; +generaterecaptcha (): void { + const possibleCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const codeLength = 6; // Change to desired length + + let recaptcha= ''; + for (let i = 0; i < codeLength; i++) { + const randomIndex = Math.floor(Math.random() * possibleCharacters.length); + recaptcha += possibleCharacters.charAt(randomIndex); + } + this.recaptchaCode = recaptcha; +} + +checkrecaptcha(control: AbstractControl): ValidationErrors | null { + if (control.value !== this.recaptchaCode) { + return { recaptchaMismatch: true }; + } + return null; +} + +recaptchaMismatch = false; + +checkrecaptchaEdit(): void { + if (this.rowSelected.recaptcha !== this. recaptchaCode) { + this. recaptchaMismatch = true; } else { this.recaptchaMismatch = false; } } + +recaptcha2Code = ''; +generaterecaptcha2 (): void { + const possibleCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const codeLength = 6; // Change to desired length + + let recaptcha2= ''; + for (let i = 0; i < codeLength; i++) { + const randomIndex = Math.floor(Math.random() * possibleCharacters.length); + recaptcha2 += possibleCharacters.charAt(randomIndex); + } + this.recaptcha2Code = recaptcha2; +} + +checkrecaptcha2(control: AbstractControl): ValidationErrors | null { + if (control.value !== this.recaptcha2Code) { + return { recaptcha2Mismatch: true }; + } + return null; +} + +recaptcha2Mismatch = false; + +checkrecaptcha2Edit(): void { + if (this.rowSelected.recaptcha2 !== this. recaptcha2Code) { + this. recaptcha2Mismatch = true; } else { this.recaptcha2Mismatch = false; } } + +// updateaction +} + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.service.ts new file mode 100644 index 0000000..d02c10d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3.service.ts @@ -0,0 +1,55 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Basicp3service{ + private baseURL = "Basicp3/Basicp3" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + + + + + + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3_cardvariable.ts new file mode 100644 index 0000000..ff91595 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Basicp3/Basicp3_cardvariable.ts @@ -0,0 +1,4 @@ +export const Basicp3cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.html new file mode 100644 index 0000000..1b6217f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.html @@ -0,0 +1,1130 @@ + +
+
+
+

Customer Information

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + Company Name + + + + Contact + Person + + + + Manufacturer + + + + Type + + + + Product + + + + Email Address + + + + Customer + Address + + + + Deployment + Type + + + + + + + dg monitoring - with fule + + + + + active + energy + + + + + + water management-stp/etp + + + + + dg monitoring - without fule + + + + + ups + monitoring + + + + + apfc + panel monitoring + + + + + busbar + monitoring + + + + + lt + panel monitoring + + + + + ht + panel monitoring + + + + + compressed air -gag monitoring + + + + + compressed air - lpg/n2/o2/co2 + + + + + water management-water monitoring + + + + + + + Quantity + + + + Price + + + + + + Description + + + + Phone Number + + + + + + + + Action + + + + + + {{user.company_name }} + + + + + + + {{user. manufactureridentifier}} + + + {{user.type }} + + + {{user.product }} + + + {{user.email_address }} + + + + + + {{user. deployment_typeidentifier}} + + + + + {{user.ups_monitoring}} + + + + {{user.active_energy}} + + + + {{user.dg_monitoring___with_fule}} + + + + {{user.water_management_stp_etp}} + + + + {{user.dg_monitoring___without_fule}} + + + + {{user.apfc_panel_monitoring}} + + + + {{user.busbar_monitoring}} + + + + {{user.lt_panel_monitoring}} + + + + {{user.ht_panel_monitoring}} + + + + {{user.compressed_air__gag_monitoring}} + + + + {{user.compressed_air___lpg_n2_o2_co2}} + + + + {{user.water_management_water_monitoring}} + + + + + + {{user.quantity }} + + + {{user.price }} + + + + + + + + {{user.phone_number }} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.ts new file mode 100644 index 0000000..ab03235 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.component.ts @@ -0,0 +1,653 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Customer_informationservice } from './Customer_information.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Customer_informationcardvariable } from './Customer_information_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Customer_information', + templateUrl: './Customer_information.component.html', + styleUrls: ['./Customer_information.component.scss'] +}) +export class Customer_informationComponent implements OnInit { + cardButton = Customer_informationcardvariable.cardButton; + cardmodeldata = Customer_informationcardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Customer_informationcardvariable.cardButton; + cardmodal; changeView() { + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine: any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Customer_information_formCode' + tableName = 'Customer_information'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Customer_informationservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; + // component button + ngOnInit(): void { + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + company_name: [null], + + contact_person: [null], + + manufacturer: [null], + + type: [null], + + + product: [null], + + + email_address: [null], + + customer_address: [null], + + deployment_type: [null], + + + + busbar_monitoring: [false], + + + + active_energy: [false], + + + + dg_monitoring___with_fule: [false], + + + + dg_monitoring___without_fule: [false], + + + + ups_monitoring: [false], + + + + apfc_panel_monitoring: [false], + + + + lt_panel_monitoring: [false], + + + + water_management_stp_etp: [false], + + + + ht_panel_monitoring: [false], + + + + compressed_air__gag_monitoring: [false], + + + + compressed_air___lpg_n2_o2_co2: [false], + + + + water_management_water_monitoring: [false], + + + + quantity: [null, [Validators.required]], + + price: [null, [Validators.required]], + + + + description: [null], + + phone_number: ['+91'], + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Customer_information_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + this.getallmanufacturer(); + + + // Listen for country changes + + + this.entryForm.get('manufacturer')?.valueChanges.subscribe((item) => { + + + if (item) { + this.dependet2type(item); + } else { + this.typedependentData = []; + this.entryForm.get('type')?.setValue(null); // clear state + } + }); + + + + // Listen for country changes + + + this.entryForm.get('type')?.valueChanges.subscribe((item) => { + + + if (item) { + this.dependet2product(item); + } else { + this.productdependentData = []; + this.entryForm.get('product')?.setValue(null); // clear state + } + }); + + + this.getalldeployment_type(); + + + + // Subscribe to value changes for auto calculation + this.entryForm.valueChanges.subscribe(() => { + this.onInputChangetotal('add'); + }); + + // Start polling for edit changes + this.editInterval = setInterval(() => { + if (this.modalEdit) { + this.onInputChangetotal('edit'); + } + }, 200); + + // Listen for product changes to auto-fill description + this.entryForm.get('product')?.valueChanges.subscribe(productName => { + if (productName && this.productdependentData) { + const found = this.productdependentData.find(p => p.product_name === productName); + console.log('found is ', found); + if (found && found.description) { + this.entryForm.patchValue({ description: found.description }); + } else { + this.entryForm.patchValue({ description: '' }); + } + // Auto-fill price when product is selected + if (found && found.price) { + this.entryForm.patchValue({ price: found.price }); + } else { + this.entryForm.patchValue({ price: null }); + } + } else { + this.entryForm.patchValue({ description: '' }); + this.entryForm.patchValue({ price: null }); + } + }); + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; + this.product = [...this.product].reverse(); if (this.product.length == 0) { + this.error = "No Data Available" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + // Dependemt Dropdown field start + this.dependet2type(row.dependentDD); + // Dependemt Dropdown field end + + // Dependemt Dropdown field start + this.dependet2product(row.dependentDD); + // Dependemt Dropdown field end + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + //calculated field start + + this.onInputChangetotal('edit'); + //calculated field end + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; this.submitted = false; + + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + + rsModalcontact_person = false; + goToReplaceStringcontact_person(row) { + this.rowSelected = row; this.rsModalcontact_person = true; + } + + selectmanufacturer; + getallmanufacturer() { + this.mainService.getAllmanufacturer().subscribe(data => { + this.selectmanufacturer = data; + console.log(data); + }, (error) => { console.log(error); }); + } + + // Dependemt Dropdown field start + + + typedependentData: any; + dependet2type(item) { + this.mainService.gettypeDependent(item).subscribe((data) => { + console.log(data); + this.typedependentData = data; + }, (error) => { console.log(error); }); + } + + + // DependemtDropdown field end + + // Dependemt Dropdown field start + + + productdependentData: any; + dependet2product(item) { + this.mainService.getproductDependent(item).subscribe((data) => { + console.log(data); + this.productdependentData = data; + }, (error) => { console.log(error); }); + } + + + // DependemtDropdown field end + + isValidemail_address(email: string): boolean { + const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; + return emailPattern.test(email); + } + + rsModalcustomer_address = false; + goToReplaceStringcustomer_address(row) { + this.rowSelected = row; this.rsModalcustomer_address = true; + } + + selectdeployment_type; + getalldeployment_type() { + this.mainService.getAlldeployment_type().subscribe(data => { + this.selectdeployment_type = data; + console.log(data); + }, (error) => { console.log(error); }); + } + + // calculated field code start + + + + totalquantity; + + + + totalprice; + + + + totaltotal; + totalcalculateOperators: 'Addition' | 'Subtraction' | 'Multiplication' | 'Division' | 'Concatination' = "Multiplication" + onInputChangetotal(mode: 'add' | 'edit') { + + + const lastObj = 0 + const lastObjstring = '' + if (mode === 'add') { + + + this.totalquantity = this.entryForm.value.quantity || ''; + + + + this.totalprice = this.entryForm.value.price || ''; + + + + } else { + + + this.totalquantity = this.rowSelected.quantity; + + + + this.totalprice = this.rowSelected.price; + + + } + + + const quantityValue = parseFloat(this.totalquantity) || 0; + + + + const priceValue = parseFloat(this.totalprice) || 0; + + + switch (this.totalcalculateOperators) { + case 'Addition': + this.totaltotal = ( + + + quantityValue + + + + + priceValue + + + + lastObj).toString(); + break; + case 'Subtraction': + this.totaltotal = ( + + + quantityValue - + + + + priceValue - + + + lastObj).toString(); + break; + case 'Multiplication': + this.totaltotal = ( + + + quantityValue * + + + + priceValue * + + + 1).toString(); + + break; + case 'Division': + + this.totaltotal = ( + + + quantityValue / + + + + priceValue / + + + 1).toString(); + + break; + case 'Concatination': + this.totaltotal = ` + + + ${this.totalquantity || ''} + + + + ${this.totalprice || ''} + + + ${lastObjstring || ''}`; + + break; + default: + this.totaltotal = ''; + } + } + + + rsModaldescription = false; + goToReplaceStringdescription(row) { + this.rowSelected = row; this.rsModaldescription = true; + } + + isValidPhone_number(phone: string): boolean { + const phonePattern = /^(\+[1-9][0-9]{0,2})?[1-9][0-9]{9}$/; + return phonePattern.test(phone); + } + + + // ================== ORDER SUMMARY LOGIC START ================== + /** + * Order Summary Array and Methods for Add to Order functionality + */ + orderSummary: any[] = []; + + /** + * Add selected product to order summary + */ + addToOrder() { + const formValue = this.entryForm.value; + if (!formValue.product || !formValue.price || !formValue.quantity) { + this.toastr.error('Please select product, price and quantity'); + return; + } + // Get description from master (productdependentData) + let productDesc = ''; + if (this.productdependentData && Array.isArray(this.productdependentData)) { + const found = this.productdependentData.find(p => p.product_name === formValue.product); + if (found && found.description) { + productDesc = found.description; + } + } + const line = this.orderSummary.length + 1; + const orderItem = { + line: line, + product: formValue.product, + description: productDesc, // always use master description + unitPrice: Number(formValue.price), + quantity: Number(formValue.quantity), + total: Number(formValue.price) * Number(formValue.quantity) + }; + this.orderSummary.push(orderItem); + this.entryForm.patchValue({ + product: null, + price: null, + quantity: 1 + }); + this.totaltotal = ''; + } + + /** + * Remove item from order summary by index + */ + removeFromOrder(index: number) { + this.orderSummary.splice(index, 1); + // Recalculate line numbers + this.orderSummary.forEach((item, i) => { + item.line = i + 1; + }); + } + + /** + * Calculate subtotal of all order items + */ + getSubtotal(): number { + return this.orderSummary.reduce((sum, item) => sum + item.total, 0); + } + + /** + * Calculate GST (18%) + */ + getGST(): number { + return this.getSubtotal() * 0.18; + } + + /** + * Calculate grand total (subtotal + GST) + */ + getGrandTotal(): number { + return this.getSubtotal() + this.getGST(); + } + // ================== ORDER SUMMARY LOGIC END ================== +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.service.ts new file mode 100644 index 0000000..a12fae0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information.service.ts @@ -0,0 +1,77 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Customer_informationservice{ + private baseURL = "Customer_information/Customer_information" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + +getAllmanufacturer(): Observable { +return this.apiRequest.get("Manufacturer_ListFilter1/Manufacturer_ListFilter1"); } + + + + gettypeDependent(field: string): Observable { + return this.apiRequest.get("Types_ListFilter1/Types_ListFilter11/" + field); + } + + + + + + getproductDependent(field: string): Observable { + return this.apiRequest.get("Product_ListFilter1/Product_ListFilter11/" + field); + } + + + + + + + +getAlldeployment_type(): Observable { +return this.apiRequest.get("Deployment_type_ListFilter1/Deployment_type_ListFilter1"); } + + + + + + + + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information_cardvariable.ts new file mode 100644 index 0000000..c036c4b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Customer_information/Customer_information_cardvariable.ts @@ -0,0 +1,4 @@ +export const Customer_informationcardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.html new file mode 100644 index 0000000..81e2b89 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.html @@ -0,0 +1,315 @@ + +
+
+
+

Deployment type

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Deployment Type + + + + + + Action + + + + + +{{user.deployment_type }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.ts new file mode 100644 index 0000000..cca1486 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component.ts @@ -0,0 +1,225 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Deployment_typeservice} from './Deployment_type.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Deployment_typecardvariable } from './Deployment_type_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Deployment_type', + templateUrl: './Deployment_type.component.html', + styleUrls: ['./Deployment_type.component.scss'] +}) +export class Deployment_typeComponent implements OnInit { + cardButton = Deployment_typecardvariable.cardButton; + cardmodeldata = Deployment_typecardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Deployment_typecardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Deployment_type_formCode' +tableName = 'Deployment_type'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Deployment_typeservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +deployment_type : [null], + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Deployment_type_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +// updateaction +} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.service.ts new file mode 100644 index 0000000..e0d4347 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type.service.ts @@ -0,0 +1,35 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Deployment_typeservice{ + private baseURL = "Deployment_type/Deployment_type" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type_cardvariable.ts new file mode 100644 index 0000000..a843bca --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Deployment_type/Deployment_type_cardvariable.ts @@ -0,0 +1,4 @@ +export const Deployment_typecardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.html new file mode 100644 index 0000000..96f9833 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.html @@ -0,0 +1,688 @@ + +
+
+
+

Dv2

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + + + test3 + + + + + name + + + + + last_name + + + + + + + + + test + + + + + + + Currency + + + + Currency2 + + + + QRCode Field + + + + QRCode Field2 + + + + BarCode Field + + + + BarCode Field2 + + + + + + + + Action + + + + + + + +{{user. test3}} + + + +{{user. name}} + + + +{{user. last_name}} + + + + + + + +{{user. test}} + + + + + +{{user.currency }} + + +{{user.currency2 }} + + +{{user.qrcode_field }} + + +{{user.qrcode_field2 }} + + +{{user.barcode_field }} + + +{{user.barcode_field2 }} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.ts new file mode 100644 index 0000000..995f9a3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.component.ts @@ -0,0 +1,471 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Dv2service} from './Dv2.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Dv2cardvariable } from './Dv2_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Dv2', + templateUrl: './Dv2.component.html', + styleUrls: ['./Dv2.component.scss'] +}) +export class Dv2Component implements OnInit { + cardButton = Dv2cardvariable.cardButton; + cardmodeldata = Dv2cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Dv2cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Dv2_formCode' +tableName = 'Dv2'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Dv2service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + + +test3:[null], + + + +name:[null], + + + +last_name:[null], + + + + + +test:[null], + + + +currency : [null, { updateOn: 'blur' }], + +currency2 : [null, { updateOn: 'blur' }], + +qrcode_field : [null], + +qrcode_field2 : [null], + +barcode_field : [null], + +barcode_field2 : [null], + + + + + + + + + + + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Dv2_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + + + + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + + + + // bar code field start + setTimeout(function(){ + JsBarcode("#barcodebarcode_field", row?.barcode_field); + }, 500); + // bar code field start + + // bar code field start + setTimeout(function(){ + JsBarcode("#barcodebarcode_field2", row?.barcode_field2); + }, 500); + // bar code field start + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + + + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + + + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + + + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + + + +//currency field start + formatCurrencycurrency () { + // Format the currency with two decimal places + this.rowSelected.currency = Number(this.rowSelected.currency ).toFixed(2); + // Remove commas from the formatted currency + this.rowSelected.currency = this.rowSelected.currency?.replace(/,/g, ''); } + //currency field end + +//currency field start + formatCurrencycurrency2 () { + // Format the currency with two decimal places + this.rowSelected.currency2 = Number(this.rowSelected.currency2 ).toFixed(2); + // Remove commas from the formatted currency + this.rowSelected.currency2 = this.rowSelected.currency2?.replace(/,/g, ''); } + //currency field end + + + + + +//bar code field start + generateBarcodebarcode_field(value) { + const barcodeValue = value; + const barcodeElement = document.getElementById("barcodebarcode_field"); + if (barcodeElement) { if (barcodeValue) { + JsBarcode(barcodeElement, barcodeValue, { format: "CODE128" + }); } else { + // Clear the barcode if the input is empty + barcodeElement.innerHTML = ''; } } } + // bar code field end + +//bar code field start + generateBarcodebarcode_field2(value) { + const barcodeValue = value; + const barcodeElement = document.getElementById("barcodebarcode_field2"); + if (barcodeElement) { if (barcodeValue) { + JsBarcode(barcodeElement, barcodeValue, { format: "CODE128" + }); } else { + // Clear the barcode if the input is empty + barcodeElement.innerHTML = ''; } } } + // bar code field end + + + +// updateaction +} + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.service.ts new file mode 100644 index 0000000..39b761c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2.service.ts @@ -0,0 +1,51 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Dv2service{ + private baseURL = "Dv2/Dv2" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2_cardvariable.ts new file mode 100644 index 0000000..d4c379f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Dv2/Dv2_cardvariable.ts @@ -0,0 +1,4 @@ +export const Dv2cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.html new file mode 100644 index 0000000..8938317 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.html @@ -0,0 +1,347 @@ + +
+
+
+

Manufacturer

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Manufacturer name + + + + Description + + + + + + Action + + + + + +{{user.manufacturer_name }} + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.ts new file mode 100644 index 0000000..7cdffee --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component.ts @@ -0,0 +1,251 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Manufacturerservice} from './Manufacturer.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Manufacturercardvariable } from './Manufacturer_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Manufacturer', + templateUrl: './Manufacturer.component.html', + styleUrls: ['./Manufacturer.component.scss'] +}) +export class ManufacturerComponent implements OnInit { + cardButton = Manufacturercardvariable.cardButton; + cardmodeldata = Manufacturercardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Manufacturercardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Manufacturer_formCode' +tableName = 'Manufacturer'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Manufacturerservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +manufacturer_name : [null], + +description : [null], + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Manufacturer_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +rsModaldescription = false; + goToReplaceStringdescription (row){ + this.rowSelected = row; this.rsModaldescription =true; } + +// updateaction +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.service.ts new file mode 100644 index 0000000..3464c0b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer.service.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Manufacturerservice{ + private baseURL = "Manufacturer/Manufacturer" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer_cardvariable.ts new file mode 100644 index 0000000..d57ae46 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Manufacturer/Manufacturer_cardvariable.ts @@ -0,0 +1,4 @@ +export const Manufacturercardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.html new file mode 100644 index 0000000..95feb06 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.html @@ -0,0 +1,445 @@ + +
+
+
+

Order summary

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Product + + + + Description + + + + Unit Price + + + + Quantity + + + + Total + + + + + + Action + + + + + +{{user.product }} + + + + + + +{{user.unit_price }} + + +{{user.quantity }} + + +{{user.total }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.ts new file mode 100644 index 0000000..ef2a3ae --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.component.ts @@ -0,0 +1,323 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Order_summaryservice} from './Order_summary.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Order_summarycardvariable } from './Order_summary_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Order_summary', + templateUrl: './Order_summary.component.html', + styleUrls: ['./Order_summary.component.scss'] +}) +export class Order_summaryComponent implements OnInit { + cardButton = Order_summarycardvariable.cardButton; + cardmodeldata = Order_summarycardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Order_summarycardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Order_summary_formCode' +tableName = 'Order_summary'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Order_summaryservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +product : [null], + +description : [null], + +unit_price : [null,[Validators.required]], + +quantity : [null,[Validators.required]], + +total : [null,[Validators.required]], + + + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Order_summary_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +rsModaldescription = false; +goToReplaceStringdescription(row){ +this.rowSelected = row; this.rsModaldescription =true; } + + + + + + + +// updateaction +} + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.service.ts new file mode 100644 index 0000000..e671e45 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary.service.ts @@ -0,0 +1,43 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Order_summaryservice{ + private baseURL = "Order_summary/Order_summary" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary_cardvariable.ts new file mode 100644 index 0000000..4f02dc9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Order_summary/Order_summary_cardvariable.ts @@ -0,0 +1,4 @@ +export const Order_summarycardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.html new file mode 100644 index 0000000..7111442 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.html @@ -0,0 +1,396 @@ + +
+
+
+

Product

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + Product Name + + + + Type name + + + Price + + + Description + + + + + Action + + + + + + {{user.product_name }} + + + {{user.type_name }} + {{user.price }} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.ts new file mode 100644 index 0000000..594e004 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.component.ts @@ -0,0 +1,254 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Productservice } from './Product.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Productcardvariable } from './Product_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Product', + templateUrl: './Product.component.html', + styleUrls: ['./Product.component.scss'] +}) +export class ProductComponent implements OnInit { + cardButton = Productcardvariable.cardButton; + cardmodeldata = Productcardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Productcardvariable.cardButton; + cardmodal; changeView() { + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine: any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Product_formCode' + tableName = 'Product'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Productservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; + // component button + ngOnInit(): void { + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + product_name: [null], + + type_name: [null], + description: [null], + price: [null], + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Product_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; + this.product = [...this.product].reverse(); if (this.product.length == 0) { + this.error = "No Data Available" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; this.submitted = false; + + + + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + rsModaldescription = false; + goToReplaceStringdescription(row) { + this.rowSelected = row; + this.rsModaldescription = true; + } + + + // updateaction +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.service.ts new file mode 100644 index 0000000..2408363 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product.service.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Productservice{ + private baseURL = "Product/Product" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product_cardvariable.ts new file mode 100644 index 0000000..d01e2f1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Product/Product_cardvariable.ts @@ -0,0 +1,4 @@ +export const Productcardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.html new file mode 100644 index 0000000..3995fc0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.html @@ -0,0 +1,349 @@ + +
+
+
+

Support

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + Description + + + + + + Action + + + + + +{{user.name }} + + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.ts new file mode 100644 index 0000000..9af1ee4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.component.ts @@ -0,0 +1,251 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Supportservice} from './Support.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Supportcardvariable } from './Support_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Support', + templateUrl: './Support.component.html', + styleUrls: ['./Support.component.scss'] +}) +export class SupportComponent implements OnInit { + cardButton = Supportcardvariable.cardButton; + cardmodeldata = Supportcardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Supportcardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Support_formCode' +tableName = 'Support'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Supportservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + +description : [null], + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Support_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +rsModaldescription = false; +goToReplaceStringdescription(row){ +this.rowSelected = row; this.rsModaldescription =true; } + +// updateaction +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.service.ts new file mode 100644 index 0000000..d3f45f1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support.service.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Supportservice{ + private baseURL = "Support/Support" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support_cardvariable.ts new file mode 100644 index 0000000..544e78a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Support/Support_cardvariable.ts @@ -0,0 +1,4 @@ +export const Supportcardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.html new file mode 100644 index 0000000..97ccc19 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.html @@ -0,0 +1,344 @@ + +
+
+
+

Types

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Type Name + + + + Manufacturer + + + + + + Action + + + + + +{{user.type_name }} + + +{{user.manufacturer }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.ts new file mode 100644 index 0000000..167465c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.component.ts @@ -0,0 +1,249 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Typesservice} from './Types.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Typescardvariable } from './Types_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Types', + templateUrl: './Types.component.html', + styleUrls: ['./Types.component.scss'] +}) +export class TypesComponent implements OnInit { + cardButton = Typescardvariable.cardButton; + cardmodeldata = Typescardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Typescardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Types_formCode' +tableName = 'Types'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Typesservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +type_name : [null], + +manufacturer : [null], + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Types_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + + + +// updateaction +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.service.ts new file mode 100644 index 0000000..8f1c9d6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types.service.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Typesservice{ + private baseURL = "Types/Types" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types_cardvariable.ts new file mode 100644 index 0000000..057f1f8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/angulardatatype/Types/Types_cardvariable.ts @@ -0,0 +1,4 @@ +export const Typescardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.html new file mode 100644 index 0000000..2851261 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.html @@ -0,0 +1,523 @@ + +
+
+
+

Defatest

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + Description + + + + Active + + + + select Field + + + + + + Action + + + + + + {{user.name }} + + + + + + + {{user.active }} + + + {{user. select_fieldidentifier}} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.ts new file mode 100644 index 0000000..7bfe2f6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.component.ts @@ -0,0 +1,445 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Defatestservice } from './Defatest.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Defatestcardvariable } from './Defatest_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Defatest', + templateUrl: './Defatest.component.html', + styleUrls: ['./Defatest.component.scss'] +}) +export class DefatestComponent implements OnInit { + cardButton = Defatestcardvariable.cardButton; + cardmodeldata = Defatestcardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Defatestcardvariable.cardButton; + cardmodal; changeView() { + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine: any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Defatest_formCode' + tableName = 'Defatest'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Defatestservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; + // component button + ngOnInit(): void { + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + name: [null], + + description: [null], + + active: [true], + + select_field: [null], + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Defatest_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + this.getallselect_field(); + + + + if (this.select_fielddefault) { + // Listen for product changes to auto-fill description + + + + this.entryForm.get('select_field')?.valueChanges.subscribe(name => { + if (name && this.selectselect_field) { + + const found = this.selectselect_field.find(p => p.name === name); + + + + console.log('found is ', found); + + // Auto-fill price when product is selected + if (found && found.description) { + this.entryForm.patchValue({ description: found.description }); + } else { + this.entryForm.patchValue({ description: null }); + } + + } + }); + } + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; + this.product = [...this.product].reverse(); if (this.product.length == 0) { + this.error = "No Data Available" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; this.submitted = false; + + + + + + + + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + + rsModaldescription = false; + goToReplaceStringdescription(row) { + this.rowSelected = row; this.rsModaldescription = true; + } + + + + select_fielddefault = true + selectselect_field; + getallselect_field() { + this.mainService.getAllselect_field().subscribe(data => { + this.selectselect_field = data; + console.log(data); + }, (error) => { console.log(error); }); + } + + + + // ================== ORDER SUMMARY LOGIC START ================== + /** + * Order Summary Array and Methods for Add to Order functionality + */ + select_fieldSummary: any[] = []; + select_fieldtotal; + isselect_fieldorder = true; + /** + * Add selected product to order summary + */ + addselect_fieldOrder() { + const formValue = this.entryForm.value; + if (!formValue.select_field) { + this.toastr.error('Please select select Field'); + return; + } + // Get description from master (selectselect_field) + + + + let select_fieldname = ''; + + + + let select_fielddescription = ''; + + + + + if (this.selectselect_field && Array.isArray(this.selectselect_field)) { + + + const found = this.selectselect_field.find(p => p.name === formValue.select_field); + + + + + + if (found && found.name) { + select_fieldname = found.name; + } + + + + + if (found && found.description) { + select_fielddescription = found.description; + } + + + + } + const line = this.select_fieldSummary.length + 1; + const orderItem = { + line: line, + + + name: select_fieldname, // always use master description + + + + + description: select_fielddescription, // always use master description + + + + // unitPrice: Number(formValue.price), + // quantity: Number(formValue.quantity), + // total: Number(formValue.price) * Number(formValue.quantity) + }; + this.select_fieldSummary.push(orderItem); + + this.select_fieldtotal = ''; + } + + /** + * Remove item from order summary by index + */ + removeselect_fieldOrder(index: number) { + this.select_fieldSummary.splice(index, 1); + // Recalculate line numbers + this.select_fieldSummary.forEach((item, i) => { + item.line = i + 1; + }); + } + + /** + * Calculate subtotal of all order items + */ + getselect_fieldSubtotal(): number { + return this.select_fieldSummary.reduce((sum, item) => sum + item.total, 0); + } + + /** + * Calculate GST (18%) + */ + getselect_fieldGST(): number { + return this.getselect_fieldSubtotal() * 0.18; + } + + /** + * Calculate grand total (subtotal + GST) + */ + getselect_fieldGrandTotal(): number { + return this.getselect_fieldSubtotal() + this.getselect_fieldGST(); + + } + // ================== ORDER SUMMARY LOGIC END ================== + + + // updateaction +} + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.service.ts new file mode 100644 index 0000000..77625fd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest.service.ts @@ -0,0 +1,42 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Defatestservice{ + private baseURL = "Defatest/Defatest" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + +getAllselect_field(): Observable { +return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest_cardvariable.ts new file mode 100644 index 0000000..f1bb60f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/defu/Defatest/Defatest_cardvariable.ts @@ -0,0 +1,4 @@ +export const Defatestcardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.html new file mode 100644 index 0000000..483d3de --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.html @@ -0,0 +1,405 @@ + +
+
+
+

Stepper Workflow

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + Description + + + + Active + + + + + + Action + + + + + + {{user. name }} + + + + + + + {{user. active }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+ + + + + +
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.ts new file mode 100644 index 0000000..56b2b42 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.ts @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Stepper_workflowservice } from './Stepper_workflow.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Stepper_workflowcardvariable } from './Stepper_workflow_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +import { ActivatedRoute, Router } from '@angular/router'; + +declare var JsBarcode: any; +@Component({ + selector: 'app-Stepper_workflow', + templateUrl: './Stepper_workflow.component.html', + styleUrls: ['./Stepper_workflow.component.scss'] +}) +export class Stepper_workflowComponent implements OnInit { + cardButton = Stepper_workflowcardvariable.cardButton; + cardmodeldata = Stepper_workflowcardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Stepper_workflowcardvariable.cardButton; + cardmodal; changeView() { + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine: any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Stepper_workflow_formCode' + tableName = 'Stepper_workflow'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Stepper_workflowservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + ) { } + // component button + ngOnInit(): void { + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + name: [null], + + description: [null], + + active: [true], + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Stepper_workflow_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + } + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; + if (this.product.length == 0) { + this.error = "No Data Available" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; + this.submitted = false; + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + + rsModaldescription = false; + goToReplaceStringdescription(row) { + this.rowSelected = row; + this.rsModaldescription = true; + } + + + gotoStepper(id) { + + console.log('id is ', id) + + // stepper route + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + this.router.navigate(["../demostepper/", id], { relativeTo: this.route }); + + + + + } + + // updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.service.ts new file mode 100644 index 0000000..da9eebd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.service.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Stepper_workflowservice{ + private baseURL = "Stepper_workflow/Stepper_workflow" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow_cardvariable.ts new file mode 100644 index 0000000..1cdd2a5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow_cardvariable.ts @@ -0,0 +1,4 @@ +export const Stepper_workflowcardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.css.map new file mode 100644 index 0000000..7e45f76 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["demostepper.component.scss","demostepper.component.css"],"names":[],"mappings":"AAAA;EACE,UAAA;EACA,YAAA;ACCF;;ADCA;EACE,UAAA;EACA,aAAA;ACEF;;ADAA;EACE,UAAA;EACA,aAAA;ACGF;;ADDA;EACE,UAAA;EACA,aAAA;ACIF;;ADDA;EACE,WAAA;EACA,aAAA;ACIF;;ADDA;EACE,WAAA;EACA,kBAAA;EACA,aAAA;EACA,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACIF;;ADFA;EACE,UAAA;ACKF;;ADHA;EACE,kBAAA;ACMF;;ADHA;EACE,WAAA;ACMF;;ADJA;EACA;IACA,WAAA;ECOE;AACF","file":"demostepper.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.html new file mode 100644 index 0000000..335cd05 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.html @@ -0,0 +1,328 @@ + + +
+ + + + + + + +
+ +
+
+
+
+

Workflow

+
+ +
+ + + + step 0 + Application Update + Datagrid + Create/registration
Information Of + Customer
+
+ + + Step 2 + Review And
Confirmation
+ + Finish . + +
+
+
+
+
+ +
+
+

registration

+

Update {{Test11entryForm.name}}

+
+ +
+ + +
+ +
+ +
+
+ + +
+ + + + + + + + + + +
+ + + +
List of picupload
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ + {{attach.uploadedfile_name}} File Preview + + + +
+
+ +
List of fileupload_field
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ + {{attach.uploadedfile_name}} File Preview + + + +
+
+ +
List of audio_field
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ + {{attach.uploadedfile_name}} + + + +
+
+ +
List of video_field
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ + {{attach.uploadedfile_name}} + + + +
+
+ +
+ +
+ +
+
+ + + +
+
+
+ +
+ +
+
+ +
+
+

Review And Confirmation

+
+ + +
+
+
Registration Summary:
+

Name : {{ Test11entryForm.get('name')?.value | json}}

+ +
+

Uploaded Images Preview:

+
+
+ +

{{ img.uploadedfile_name }}

+
+
+
+ +
+

Uploaded Files Preview:

+
+
+ + + +

{{ file.uploadedfile_name }}

+
+
+
+ + +
+

Uploaded Audios Preview:

+
+
+ +

{{ audio.uploadedfile_name }}

+
+
+
+ + +
+

Uploaded Videos Preview:

+
+
+ +

{{ video.uploadedfile_name }}

+
+
+
+ + + +
+
+
+ + +
+
+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.scss new file mode 100644 index 0000000..35a9e5a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.scss @@ -0,0 +1,46 @@ +.horizontal{ + width: 25%; + padding: 5px; +} +.horizontal1{ + width: 50%; + padding: 10px; +} +.middle{ + width: 33%; + padding: 10px; +} +.middle1{ + width: 75%; + padding: 10px; +} + +.full{ + width: 100%; + padding: 10px; +} + +input[type=text],[type=date], select { + width: 100%; + padding: 12px 20px; + margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +} +.center { + text-align: center; + +} +.center{ + color: blue; +} +@media (max-width: 600px){ +.horizontal,.middle,.horizontal1,.middle1 { +width: 100%; +}} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.spec.ts new file mode 100644 index 0000000..2c47bc5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { demostepperComponent } from './demostepper.component'; + +describe('demostepperComponent', () => { + let component: demostepperComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ demostepperComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(demostepperComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.ts new file mode 100644 index 0000000..40e17a7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.component.ts @@ -0,0 +1,525 @@ +import { Component, OnInit } from '@angular/core'; + + +import { ToastrService } from 'ngx-toastr'; +import { ActivatedRoute, Router } from '@angular/router'; +import { College } from 'src/app/models/fnd/play'; +import { student } from 'src/app/models/fnd/Studentadd'; +import { AbstractControl,FormArray, FormBuilder, FormGroup, ValidationErrors, Validators } from '@angular/forms'; +import { Observable } from 'rxjs'; +import { ValidationError } from 'src/app/models/fnd/ValidationError'; +import { demostepperservice } from './demostepper.service'; +declare var JsBarcode: any; + @Component({ + selector: 'app-editstepper', + templateUrl: './demostepper.component.html', + styleUrls: ['./demostepper.component.scss'] +}) +export class demostepperComponent implements OnInit { + updated = false; + stringJson: any; + customerId: string = ''; + selectedFile!: File; + fileName = ''; + + id: number; + errorFields: ValidationError[] = []; + appToUpdate: College = null; + trained = false; + + json: string = ""; + luisApp = + { + name: '', + created: 1, + trained: 1, + tested: 1, + updated: 1, + published: 1, + + }; + // Layout direction changing + layout = { + direction: "vertical", + block1: "clr-col-lg-3 clr-col-12 ", + block2: "clr-col-lg-9 clr-col-12 ", + }; + + timelineStyle = { + step0: { state: "current", open: true, failed: false }, + step1: { state: "not-started", open: false, failed: false }, +}; +public Test11entryForm: FormGroup; + submitted = false; + rowSelected: any = {}; + modalcomplete = false; + + constructor( +private mainService: demostepperservice, + +private Test11_fb: FormBuilder, +private router: Router, + private route: ActivatedRoute, + private toastr: ToastrService, + ) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + + + this.Test11entryForm = this.Test11_fb.group({ +name : [null], + + + + + + + + + + + }); + + + + + + + + + + + const stepId = this.id; // or from route/query/etc + + this.getResolvedDataFromStepper(stepId).subscribe(res => { + console.log('response get ', res); + + if (res === null) { + this.showEmptyForm(); + } else { + if (res['Test11']) { + + this.prefillregistrationForm(res['Test11']); + } +} + }); + + } +showEmptyForm(): void { + console.log('No config found. Showing empty form.'); + // You can choose to show one or both based on some logic + + this.Test11entryForm.reset(); + } + prefillregistrationForm(data: any): void { + + console.log(' registration data ', data) + this.Test11entryForm.patchValue({ + id: data.id || '', +name: data.name || '', + +picupload: data.picupload || '', + +fileupload_field: data.fileupload_field || '', + +audio_field: data.audio_field || '', + +video_field: data.video_field || '', + + }); + } + getResolvedDataFromStepper(id: number): Observable { + console.log('get step config'); + + return new Observable(observer => { + this.mainService.gettabledata(id).subscribe(configList => { + if (!configList || configList.length === 0) { + console.log('empty config'); + observer.next(null); + observer.complete(); + return; + } + + const results: { [key: string]: any } = {}; + let processed = 0; + + configList.forEach(config => { + const { table_name, table_id } = config; + + this.getByTableNameAndId(table_name, table_id).subscribe(data => { + + console.log(table_name, ' data is ', data); + results[table_name] = data; + + processed++; + if (processed === configList.length) { + observer.next(results); // emit combined data + observer.complete(); + } + + }, error => { + console.error(`Error loading data for table ${table_name}`, error); + processed++; + if (processed === configList.length) { + observer.next(results); // continue with what we have + observer.complete(); + } + }); + }); + + }, error => { + console.error("Error loading stepper config", error); + observer.error(error); + }); + }); + } + + + + getByTableNameAndId(tableName: string, id: number): Observable { + + switch (tableName) { + + case 'Test11': + return this.mainService.getTest11ById(id);// aur bhi cases agar naye table add ho to + default: + throw new Error(`Unknown table name: ${tableName}`); + } + } + // Change to Horizontal Layout + changeToHorizonTal() { + this.layout = { + direction: "horizontal", + block1: "clr-col-lg-12 clr-col-12 height container", + block2: "clr-col-lg-12 clr-col-12 container", + } + } + // Change to Vertical Layout + changeToVertical() { + this.layout = { + direction: "vertical", + block1: "clr-col-lg-3 clr-col-12 ", + block2: "clr-col-lg-9 clr-col-12 ", + } + } + + + + onregistrationSave() { + console.log('Form Submitted:', this.Test11entryForm.value); + this.submitted = true; + if (this.Test11entryForm.invalid) { + + console.log('invalid form ..'); + // Log all form errors + Object.keys(this.Test11entryForm.controls).forEach(field => { + const control = this.Test11entryForm.get(field); + if (control && control.invalid) { + console.log(`Error in field: ${field}`, control.errors); + } + } + ); + return; + } + this.onregistrationCreate(); + } + + onregistrationCreate() { + + + + + + + + + + + this.mainService.createTest11(this.Test11entryForm.value).subscribe( + (data) => { + console.log('adding data ', data); + this.customerId = data.id; + + console.log('id is ', this.customerId); + + + const tableId = data.id; + const tableName = 'Test11'; + const stepperId = this.id; + + // Save stepper config + this.mainService.saveStepperConfig(stepperId, tableId, tableName).subscribe(() => { + this.toastr.success("Stepper Config Saved"); + }); if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + +for (let i = 0; i < this.selectedpicupload.length; i++){ + + this.mainService.uploadPicupload(data.id,tableName,this.selectedpicupload[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedfileupload_field.length; i++){ + + this.mainService.uploadfilefileupload_field(data.id,tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedaudio_field.length; i++){ + + this.mainService.uploadAudio_field(data.id,tableName,this.selectedaudio_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedvideo_field.length; i++){ + + this.mainService.uploadVideo_field(data.id,tableName,this.selectedvideo_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + this.rowSelected = this.Test11entryForm.value; + + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + + + onnext() { + this.router.navigate(["../../main/workflow"], { relativeTo: this.route }); + } + reset() { + this.json = ""; + this.luisApp = + { + name: '', + trained: 1, + tested: 1, + updated: 1, + published: 1, + created: 1, + + }; + + this.timelineStyle = { + step0: { state: "current", open: true, failed: false }, + step1: { state: "not-started", open: false, failed: false }, + }; + } + current() { + console.log(this.timelineStyle) + this.stringJson = JSON.stringify(this.timelineStyle); + console.log("String json object :", this.stringJson); + + } + + +filePreviewpicupload: string | ArrayBuffer | null = null; +FileDatapicupload: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedpicupload: File[]=[]; +public onFileChangedpicupload(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatapicupload[index].uploadedfile_name = files[i].name; + this.selectedpicupload.push(files[i]); + if (file.type.startsWith('image/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDatapicupload[index] = { + ...this.FileDatapicupload[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinespicupload(){ + this.FileDatapicupload.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowpicupload(index,id) { + this.FileDatapicupload.splice(index, 1); + + if(id){ + this.mainService.uploadPicuploaddelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewfileupload_field: string | ArrayBuffer | null = null; +FileDatafileupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedfileupload_field: File[]=[]; +public onFileChangedfileupload_field(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatafileupload_field[index].uploadedfile_name = files[i].name; + this.selectedfileupload_field.push(files[i]); + if (file.type.startsWith('file/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDatafileupload_field[index] = { + ...this.FileDatafileupload_field[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesfileupload_field(){ + this.FileDatafileupload_field.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowfileupload_field(index,id) { + this.FileDatafileupload_field.splice(index, 1); + + if(id){ + this.mainService.uploadfiledeletefileupload_field(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewaudio_field: string | ArrayBuffer | null = null; +FileDataaudio_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedaudio_field: File[]=[]; +public onFileChangedaudio_field(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDataaudio_field[index].uploadedfile_name = files[i].name; + this.selectedaudio_field.push(files[i]); + if (file.type.startsWith('audio/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDataaudio_field[index] = { + ...this.FileDataaudio_field[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesaudio_field(){ + this.FileDataaudio_field.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowaudio_field(index,id) { + this.FileDataaudio_field.splice(index, 1); + + if(id){ + this.mainService.uploadAudio_fielddelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewvideo_field: string | ArrayBuffer | null = null; +FileDatavideo_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedvideo_field: File[]=[]; +public onFileChangedvideo_field(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatavideo_field[index].uploadedfile_name = files[i].name; + this.selectedvideo_field.push(files[i]); + if (file.type.startsWith('video/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDatavideo_field[index] = { + ...this.FileDatavideo_field[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesvideo_field(){ + this.FileDatavideo_field.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowvideo_field(index,id) { + this.FileDatavideo_field.splice(index, 1); + + if(id){ + this.mainService.uploadVideo_fielddelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + + + +FileDataPicupload: any[]; + selectedPicupload: any[]; + + + +FileDataAudio_field: any[]; + selectedAudio_field: any[]; + +FileDataVideo_field: any[]; + selectedVideo_field: any[]; + + +// updateaction +} + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.service.ts new file mode 100644 index 0000000..55ee1e3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/demostepper/demostepper.service.ts @@ -0,0 +1,108 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class demostepperservice{ + private StepperURL = "Stepper_table_config/Stepper_table_config"; + private Test11URL = "Test11/Test11" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } +gettabledata(id: number): Observable { + const _http = this.StepperURL + "/stepId/" + id; + return this.apiRequest.get(_http); + } + + saveStepperConfig(stepperId: number, tableId: number, tableName: string): Observable { + const params = new HttpParams() + .set('stepperId', stepperId.toString()) + .set('tableId', tableId.toString()) + .set('tableName', tableName); + + return this.apiRequest.post(this.StepperURL, null, params); // null body, params used + } getAllTest11(page?: number, size?: number): Observable { + return this.apiRequest.get(this.Test11URL); + } + getTest11ById(id: number): Observable { + const _http = this.Test11URL + "/" + id; + return this.apiRequest.get(_http); + } + createTest11(data: any): Observable { + return this.apiRequest.post(this.Test11URL, data); + } + updateTest11(id: number, data: any): Observable { + const _http = this.Test11URL + "/" + id; + return this.apiRequest.put(_http, data); + } + deleteTest11(id: number): Observable { + const _http = this.Test11URL + "/" + id; + return this.apiRequest.delete(_http); + } + + + uploadPicupload(ref:any, Test11:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Test11}`, formData); + } + + uploadPicuploadgetById(ref:any, Test11:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Test11}`); + } + + + uploadPicuploaddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadfilefileupload_field(ref:any, Test11:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Test11}`, formData); + } + + uploadfilegetByIdfileupload_field(ref:any, Test11:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Test11}`); + } + + + uploadfiledeletefileupload_field(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadAudio_field(ref:any, Test11:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Test11}`, formData); + } + + uploadAudio_fieldgetById(ref:any, Test11:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Test11}`); + } + + + uploadAudio_fielddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadVideo_field(ref:any, Test11:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Test11}`, formData); + } + + uploadVideo_fieldgetById(ref:any, Test11:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Test11}`); + } + + + uploadVideo_fielddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.css.map new file mode 100644 index 0000000..07fc40a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["steptest1.component.scss","steptest1.component.css"],"names":[],"mappings":"AAAA;EACE,UAAA;EACA,YAAA;ACCF;;ADCA;EACE,UAAA;EACA,aAAA;ACEF;;ADAA;EACE,UAAA;EACA,aAAA;ACGF;;ADDA;EACE,UAAA;EACA,aAAA;ACIF;;ADDA;EACE,WAAA;EACA,aAAA;ACIF;;ADDA;EACE,WAAA;EACA,kBAAA;EACA,aAAA;EACA,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACIF;;ADFA;EACE,UAAA;ACKF;;ADHA;EACE,kBAAA;ACMF;;ADHA;EACE,WAAA;ACMF;;ADJA;EACA;IACA,WAAA;ECOE;AACF","file":"steptest1.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.html new file mode 100644 index 0000000..77128e2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.html @@ -0,0 +1,232 @@ + + +
+ + + + + + + +
+ +
+
+
+
+

Workflow

+
+ +
+ + + + step 0 + Application Update + Datagrid + Create/registration
Information Of + Customer
+
+ + + step 1 + Application Update + Datagrid + Create/File_upload
Information Of + Customer
+
+ + + Step 2 + Review And
Confirmation
+ + Finish . + +
+
+
+
+
+ +
+
+

registration

+

Update {{Test11entryForm.name}}

+
+ +
+ + +
+ +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + + +
+ +
+ +
+
+ + + +
+
+
+ +
+ +
+
+ +
+
+

File_upload

+

Update {{Test22entryForm.name}}

+
+ +
+ + +
+ +
+ +
+
+ + +
+ + + + +
+ + + +
List of fileupload_field
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ + {{attach.uploadedfile_name}} File Preview + + + +
+
+ +
+ +
+ +
+
+ + + +
+
+
+ +
+ +
+
+ +
+
+

Review And Confirmation

+
+ + +
+
+
registration Summary:
+

Name : {{ Test11entryForm.get('name')?.value }}

+ +

Description : {{ Test11entryForm.get('description')?.value }}

+ +

Active : {{ Test11entryForm.get('active')?.value }}

+ + +
+
+
+
+
File_upload Summary:
+

Name : {{ Test22entryForm.get('name')?.value }}

+ +

Fileupload Field : {{ Test22entryForm.get('fileupload_field')?.value }}

+ + +
+
+
+ + +
+
+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.scss new file mode 100644 index 0000000..35a9e5a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.scss @@ -0,0 +1,46 @@ +.horizontal{ + width: 25%; + padding: 5px; +} +.horizontal1{ + width: 50%; + padding: 10px; +} +.middle{ + width: 33%; + padding: 10px; +} +.middle1{ + width: 75%; + padding: 10px; +} + +.full{ + width: 100%; + padding: 10px; +} + +input[type=text],[type=date], select { + width: 100%; + padding: 12px 20px; + margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +} +.center { + text-align: center; + +} +.center{ + color: blue; +} +@media (max-width: 600px){ +.horizontal,.middle,.horizontal1,.middle1 { +width: 100%; +}} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.spec.ts new file mode 100644 index 0000000..939f9b2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { steptest1Component } from './steptest1.component'; + +describe('steptest1Component', () => { + let component: steptest1Component; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ steptest1Component ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(steptest1Component); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.ts new file mode 100644 index 0000000..c4b2415 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.component.ts @@ -0,0 +1,476 @@ +import { Component, OnInit } from '@angular/core'; + + +import { ToastrService } from 'ngx-toastr'; +import { ActivatedRoute, Router } from '@angular/router'; +import { College } from 'src/app/models/fnd/play'; +import { student } from 'src/app/models/fnd/Studentadd'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Observable } from 'rxjs'; +import { ValidationError } from 'src/app/models/fnd/ValidationError'; +import { steptest1service } from './steptest1.service'; +@Component({ + selector: 'app-editstepper', + templateUrl: './steptest1.component.html', + styleUrls: ['./steptest1.component.scss'] +}) +export class steptest1Component implements OnInit { + updated = false; + stringJson: any; + customerId: string = ''; + selectedFile!: File; + fileName = ''; + + id: number; + errorFields: ValidationError[] = []; + appToUpdate: College = null; + trained = false; + + json: string = ""; + luisApp = + { + name: '', + created: 1, + trained: 1, + tested: 1, + updated: 1, + published: 1, + + }; + // Layout direction changing + layout = { + direction: "vertical", + block1: "clr-col-lg-3 clr-col-12 ", + block2: "clr-col-lg-9 clr-col-12 ", + }; + + timelineStyle = { + step0: { state: "current", open: true, failed: false }, + step1: { state: "not-started", open: false, failed: false }, + step2: { state: "not-started", open: false, failed: false }, +}; +public Test11entryForm: FormGroup; +public Test22entryForm: FormGroup; + submitted = false; + rowSelected: any = {}; + modalcomplete = false; + + constructor( +private mainService: steptest1service, + +private registration_fb: FormBuilder, +private File_upload_fb: FormBuilder, +private router: Router, + private route: ActivatedRoute, + private toastr: ToastrService, + ) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + + + this.Test11entryForm = this.registration_fb.group({ +name : [null], + +description : [null], + +active : [true], + + + }); + + + + + + + this.Test22entryForm = this.File_upload_fb.group({ +name : [null], + + + + + }); + + + + + + + + + + + + + + + const stepId = this.id; // or from route/query/etc + + this.getResolvedDataFromStepper(stepId).subscribe(res => { + console.log('response get ', res); + + if (res === null) { + this.showEmptyForm(); + } else { + if (res['Test11']) { + + this.prefillregistrationForm(res['Test11']); + } + + if (res['Test22']) { + + this.prefillFile_uploadForm(res['Test22']); + } +} + }); + + } +showEmptyForm(): void { + console.log('No config found. Showing empty form.'); + // You can choose to show one or both based on some logic + + this.Test11entryForm.reset(); + + this.Test22entryForm.reset(); + } prefillregistrationForm(data: any): void { + + console.log(' registration data ', data) + this.Test11entryForm.patchValue({ + id: data.id || '', +name: data.name || '', + +description: data.description || '', + +active: data.active || '', + + }); + } prefillFile_uploadForm(data: any): void { + + console.log(' File_upload data ', data) + this.Test22entryForm.patchValue({ + id: data.id || '', +name: data.name || '', + +fileupload_field: data.fileupload_field || '', + + }); + } + getResolvedDataFromStepper(id: number): Observable { + console.log('get step config'); + + return new Observable(observer => { + this.mainService.gettabledata(id).subscribe(configList => { + if (!configList || configList.length === 0) { + console.log('empty config'); + observer.next(null); + observer.complete(); + return; + } + + const results: { [key: string]: any } = {}; + let processed = 0; + + configList.forEach(config => { + const { table_name, table_id } = config; + + this.getByTableNameAndId(table_name, table_id).subscribe(data => { + + console.log('data is ', data); + results[table_name] = data; + + processed++; + if (processed === configList.length) { + observer.next(results); // emit combined data + observer.complete(); + } + + }, error => { + console.error(`Error loading data for table ${table_name}`, error); + processed++; + if (processed === configList.length) { + observer.next(results); // continue with what we have + observer.complete(); + } + }); + }); + + }, error => { + console.error("Error loading stepper config", error); + observer.error(error); + }); + }); + } + + + + getByTableNameAndId(tableName: string, id: number): Observable { + + switch (tableName) { + case 'Test11': + return this.mainService.getTest11ById(id); case 'Test22': + return this.mainService.getTest22ById(id);// aur bhi cases agar naye table add ho to + default: + throw new Error(`Unknown table name: ${tableName}`); + } + } + // Change to Horizontal Layout + changeToHorizonTal() { + this.layout = { + direction: "horizontal", + block1: "clr-col-lg-12 clr-col-12 height container", + block2: "clr-col-lg-12 clr-col-12 container", + } + } + // Change to Vertical Layout + changeToVertical() { + this.layout = { + direction: "vertical", + block1: "clr-col-lg-3 clr-col-12 ", + block2: "clr-col-lg-9 clr-col-12 ", + } + } + + + + onregistrationSave() { + console.log('Form Submitted:', this.Test11entryForm.value); + this.submitted = true; + if (this.Test11entryForm.invalid) { + + console.log('invalid form ..'); + // Log all form errors + Object.keys(this.Test11entryForm.controls).forEach(field => { + const control = this.Test11entryForm.get(field); + if (control && control.invalid) { + console.log(`Error in field: ${field}`, control.errors); + } + } + ); + return; + } + this.onregistrationCreate(); + } + + onregistrationCreate() { + + + + + + + this.mainService.createTest11(this.Test11entryForm.value).subscribe( + (data) => { + console.log('adding data ', data); + this.customerId = data.id; + + console.log('id is ', this.customerId); + + + const tableId = data.id; + const tableName = 'Test11'; + const stepperId = this.id; + + // Save stepper config + this.mainService.saveStepperConfig(stepperId, tableId, tableName).subscribe(() => { + this.toastr.success("Stepper Config Saved"); + }); if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + this.rowSelected = this.Test11entryForm.value; + + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + + + onFile_uploadSave() { + console.log('Form Submitted:', this.Test22entryForm.value); + this.submitted = true; + if (this.Test22entryForm.invalid) { + + console.log('invalid form ..'); + // Log all form errors + Object.keys(this.Test22entryForm.controls).forEach(field => { + const control = this.Test22entryForm.get(field); + if (control && control.invalid) { + console.log(`Error in field: ${field}`, control.errors); + } + } + ); + return; + } + this.onFile_uploadCreate(); + } + + onFile_uploadCreate() { + + + + + this.mainService.createTest22(this.Test22entryForm.value).subscribe( + (data) => { + console.log('adding data ', data); + this.customerId = data.id; + + console.log('id is ', this.customerId); + + + const tableId = data.id; + const tableName = 'Test22'; + const stepperId = this.id; + + // Save stepper config + this.mainService.saveStepperConfig(stepperId, tableId, tableName).subscribe(() => { + this.toastr.success("Stepper Config Saved"); + }); if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + +for (let i = 0; i < this.selectedfileupload_field.length; i++){ + + this.mainService.uploadfilefileupload_field(data.id,tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + this.rowSelected = this.Test22entryForm.value; + + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + + + onnext() { + this.router.navigate(["../../main/workflow"], { relativeTo: this.route }); + } + reset() { + this.json = ""; + this.luisApp = + { + name: '', + trained: 1, + tested: 1, + updated: 1, + published: 1, + created: 1, + + }; + + this.timelineStyle = { + step0: { state: "current", open: true, failed: false }, + step1: { state: "not-started", open: false, failed: false }, + step2: { state: "not-started", open: false, failed: false }, + }; + } + current() { + console.log(this.timelineStyle) + this.stringJson = JSON.stringify(this.timelineStyle); + console.log("String json object :", this.stringJson); + + } + + +filePreviewfileupload_field: string | ArrayBuffer | null = null; +FileDatafileupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedfileupload_field: File[]=[]; +public onFileChangedfileupload_field(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatafileupload_field[index].uploadedfile_name = files[i].name; + this.selectedfileupload_field.push(files[i]); + if (file.type.startsWith('file/')) { + const reader = new FileReader(); + reader.onload = (e) => { + // Set the file preview source + const filePreview = e.target?.result as string; + this.FileDatafileupload_field[index] = { + ...this.FileDatafileupload_field[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesfileupload_field(){ + this.FileDatafileupload_field.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + deleteRowfileupload_field(index,id) { + this.FileDatafileupload_field.splice(index, 1); + + if(id){ + this.mainService.uploadfiledeletefileupload_field(id).subscribe(data =>{ + console.log(data); + }) + } + } + + + + + + + + + + + +// updateaction +} + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.service.ts new file mode 100644 index 0000000..1976db0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steptest1/steptest1.service.ts @@ -0,0 +1,87 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class steptest1service{ + private StepperURL = "Stepper_table_config/Stepper_table_config"; + private Test11URL = "Test11/Test11" ; private Test22URL = "Test22/Test22" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } +gettabledata(id: number): Observable { + const _http = this.StepperURL + "/stepId/" + id; + return this.apiRequest.get(_http); + } + + saveStepperConfig(stepperId: number, tableId: number, tableName: string): Observable { + const params = new HttpParams() + .set('stepperId', stepperId.toString()) + .set('tableId', tableId.toString()) + .set('tableName', tableName); + + return this.apiRequest.post(this.StepperURL, null, params); // null body, params used + } getAllTest11(page?: number, size?: number): Observable { + return this.apiRequest.get(this.Test11URL); + } + getTest11ById(id: number): Observable { + const _http = this.Test11URL + "/" + id; + return this.apiRequest.get(_http); + } + createTest11(data: any): Observable { + return this.apiRequest.post(this.Test11URL, data); + } + updateTest11(id: number, data: any): Observable { + const _http = this.Test11URL + "/" + id; + return this.apiRequest.put(_http, data); + } + deleteTest11(id: number): Observable { + const _http = this.Test11URL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + getAllTest22(page?: number, size?: number): Observable { + return this.apiRequest.get(this.Test22URL); + } + getTest22ById(id: number): Observable { + const _http = this.Test22URL + "/" + id; + return this.apiRequest.get(_http); + } + createTest22(data: any): Observable { + return this.apiRequest.post(this.Test22URL, data); + } + updateTest22(id: number, data: any): Observable { + const _http = this.Test22URL + "/" + id; + return this.apiRequest.put(_http, data); + } + deleteTest22(id: number): Observable { + const _http = this.Test22URL + "/" + id; + return this.apiRequest.delete(_http); + } + + + uploadfilefileupload_field(ref:any, Test22:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Test22}`, formData); + } + + uploadfilegetByIdfileupload_field(ref:any, Test22:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Test22}`); + } + + + uploadfiledeletefileupload_field(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.html new file mode 100644 index 0000000..75c7b56 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.html @@ -0,0 +1,376 @@ + +
+
+
+

Childform

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + Description + + + + Active + + + + + + Action + + + + + +{{user.name }} + + + + + + +{{user.active }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.ts new file mode 100644 index 0000000..6a60776 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.component.ts @@ -0,0 +1,275 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Childformservice} from './Childform.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Childformcardvariable } from './Childform_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Childform', + templateUrl: './Childform.component.html', + styleUrls: ['./Childform.component.scss'] +}) +export class ChildformComponent implements OnInit { + cardButton = Childformcardvariable.cardButton; + cardmodeldata = Childformcardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Childformcardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Childform_formCode' +tableName = 'Childform'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Childformservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + +description : [null], + +active : [true], + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Childform_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +rsModaldescription = false; +goToReplaceStringdescription(row){ +this.rowSelected = row; this.rsModaldescription =true; } + + + +// updateaction +} + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.service.ts new file mode 100644 index 0000000..3c8571d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform.service.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Childformservice{ + private baseURL = "Childform/Childform" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform_cardvariable.ts new file mode 100644 index 0000000..8809902 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stpkg/Childform/Childform_cardvariable.ts @@ -0,0 +1,4 @@ +export const Childformcardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/test.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/test.html new file mode 100644 index 0000000..815da4a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/test.html @@ -0,0 +1,20 @@ + + + + +gaurav + + + + +

this is h1

+

this is h1

+

this is h1

+

this is h1

+

Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ipsa fuga, asperiores mollitia iste vitae repellendus adipisci atque eum corrupti ad placeat unde voluptatum quia perferendis neque expedita, sequi iure quo. Ut error adipisci ex cum sint, suscipit, voluptatem repellat nemo dolorum unde dolores quasi aut. A earum quo mollitia voluptatibus!

+ + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.html new file mode 100644 index 0000000..eb002f3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.html @@ -0,0 +1,383 @@ + +
+
+
+

Country

+
+
+ + + + + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + Description + + + + Active + + + + + + Action + + + + + +{{user.name }} + + + + + + +{{user.active }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.ts new file mode 100644 index 0000000..9a72264 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.component.ts @@ -0,0 +1,293 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Countryservice} from './Country.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Countrycardvariable } from './Country_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +import { ActivatedRoute, Router } from '@angular/router'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Country', + templateUrl: './Country.component.html', + styleUrls: ['./Country.component.scss'] +}) +export class CountryComponent implements OnInit { + cardButton = Countrycardvariable.cardButton; + cardmodeldata = Countrycardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Countrycardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Country_formCode' +tableName = 'Country'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Countryservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + +description : [null], + +active : [true], + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Country_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +rsModaldescription = false; +goToReplaceStringdescription(row){ +this.rowSelected = row; this.rsModaldescription =true; } + + + + goToDataM(){ + this.router.navigate(['/cns-portal/datamanagement'],{ relativeTo: this.route }); + } + + +downloadCSV(tableName): void { + this.mainService.downloadCSV(tableName).subscribe(response => { + const blob = new Blob([response], { type: 'application/octet-stream' }); + const url = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `${tableName}.csv`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + }); +}// updateaction +} + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.service.ts new file mode 100644 index 0000000..786c0b2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country.service.ts @@ -0,0 +1,44 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class Countryservice{ + private baseURL = "Country/Country" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + +downloadCSV(tableName: string): Observable { + const url = `${baseUrl}/api/template/download-csv?tableName=${tableName}`; + return this.http.get(url, { responseType: 'blob' }) + +}// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country_cardvariable.ts new file mode 100644 index 0000000..efc9e50 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Country/Country_cardvariable.ts @@ -0,0 +1,4 @@ +export const Countrycardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.html new file mode 100644 index 0000000..cd24628 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.html @@ -0,0 +1,412 @@ + +
+
+
+

District

+
+
+ + + + + + +
+ + + + Loading ... + +
{{error}}
+
+ + district name + + + + Description + + + + Active + + + + state name + + + + + + Action + + + + + +{{user.district_name }} + + + + + + +{{user.active }} + + +{{user.state_name }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.ts new file mode 100644 index 0000000..0f347e0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.component.ts @@ -0,0 +1,317 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Districtservice} from './District.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Districtcardvariable } from './District_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +import { ActivatedRoute, Router } from '@angular/router'; +declare var JsBarcode: any; +@Component({ + selector: 'app-District', + templateUrl: './District.component.html', + styleUrls: ['./District.component.scss'] +}) +export class DistrictComponent implements OnInit { + cardButton = Districtcardvariable.cardButton; + cardmodeldata = Districtcardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Districtcardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'District_formCode' +tableName = 'District'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Districtservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +district_name : [null], + +description : [null], + +active : [true], + +state_name : [null], + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "District_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +rsModaldescription = false; +goToReplaceStringdescription(row){ +this.rowSelected = row; this.rsModaldescription =true; } + + + + + + goToDataM(){ + this.router.navigate(['/cns-portal/datamanagement'],{ relativeTo: this.route }); + } + + +downloadCSV(tableName): void { + this.mainService.downloadCSV(tableName).subscribe(response => { + const blob = new Blob([response], { type: 'application/octet-stream' }); + const url = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `${tableName}.csv`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + }); +}// updateaction +} + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.service.ts new file mode 100644 index 0000000..3ce9204 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District.service.ts @@ -0,0 +1,46 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class Districtservice{ + private baseURL = "District/District" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + +downloadCSV(tableName: string): Observable { + const url = `${baseUrl}/api/template/download-csv?tableName=${tableName}`; + return this.http.get(url, { responseType: 'blob' }) + +}// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District_cardvariable.ts new file mode 100644 index 0000000..7dd47dd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/District/District_cardvariable.ts @@ -0,0 +1,4 @@ +export const Districtcardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.html new file mode 100644 index 0000000..48e4a66 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.html @@ -0,0 +1,412 @@ + +
+
+
+

State

+
+
+ + + + + + +
+ + + + Loading ... + +
{{error}}
+
+ + state name + + + + Description + + + + Active + + + + country name + + + + + + Action + + + + + +{{user.state_name }} + + + + + + +{{user.active }} + + +{{user.country_name }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.ts new file mode 100644 index 0000000..de1a50e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.component.ts @@ -0,0 +1,317 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Stateservice} from './State.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Statecardvariable } from './State_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +import { ActivatedRoute, Router } from '@angular/router'; +declare var JsBarcode: any; +@Component({ + selector: 'app-State', + templateUrl: './State.component.html', + styleUrls: ['./State.component.scss'] +}) +export class StateComponent implements OnInit { + cardButton = Statecardvariable.cardButton; + cardmodeldata = Statecardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Statecardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'State_formCode' +tableName = 'State'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Stateservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +state_name : [null], + +description : [null], + +active : [true], + +country_name : [null], + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "State_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +rsModaldescription = false; +goToReplaceStringdescription(row){ +this.rowSelected = row; this.rsModaldescription =true; } + + + + + + goToDataM(){ + this.router.navigate(['/cns-portal/datamanagement'],{ relativeTo: this.route }); + } + + +downloadCSV(tableName): void { + this.mainService.downloadCSV(tableName).subscribe(response => { + const blob = new Blob([response], { type: 'application/octet-stream' }); + const url = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `${tableName}.csv`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + }); +}// updateaction +} + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.service.ts new file mode 100644 index 0000000..bb13104 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State.service.ts @@ -0,0 +1,46 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class Stateservice{ + private baseURL = "State/State" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + +downloadCSV(tableName: string): Observable { + const url = `${baseUrl}/api/template/download-csv?tableName=${tableName}`; + return this.http.get(url, { responseType: 'blob' }) + +}// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State_cardvariable.ts new file mode 100644 index 0000000..fce7bf8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/State/State_cardvariable.ts @@ -0,0 +1,4 @@ +export const Statecardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.html b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.html new file mode 100644 index 0000000..b0c32f7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.html @@ -0,0 +1,432 @@ + +
+
+
+

Test2

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + Name + + + + country + + + + + + Action + + + + + +{{user.name }} + + +{{user. countryidentifier}} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.scss b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.ts new file mode 100644 index 0000000..16edb30 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.component.ts @@ -0,0 +1,389 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Test2service} from './Test2.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Test2cardvariable } from './Test2_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Test2', + templateUrl: './Test2.component.html', + styleUrls: ['./Test2.component.scss'] +}) +export class Test2Component implements OnInit { + cardButton = Test2cardvariable.cardButton; + cardmodeldata = Test2cardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Test2cardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Test2_formCode' +tableName = 'Test2'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Test2service, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +name : [null], + +country : [null], + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Test2_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + +this.getallcountry(); + + + + if (this.countrydefault) { + // Listen for product changes to auto-fill description + this.entryForm.get('country')?.valueChanges.subscribe(name => { + if (name && this.selectcountry) { + + const found = this.selectcountry.find(p => p.Description === name); + + console.log('found is ', found); + + // Auto-fill price when product is selected + if (found && found.Name) { + this.entryForm.patchValue({ Name: found.Description }); + } else { + this.entryForm.patchValue({ Name: null }); + } + + } + }); +} + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + +countrydefault=true +selectcountry ; +getallcountry() { + this.mainService.getAllcountry().subscribe(data=>{ +this.selectcountry = data; +console.log(data); +},(error) => { console.log(error); }); } + + + + // ================== ORDER SUMMARY LOGIC START ================== + /** + * Order Summary Array and Methods for Add to Order functionality + */ + countrySummary: any[] = []; + countrytotal; +iscountryorder =true; + /** + * Add selected product to order summary + */ + addcountryOrder() { + const formValue = this.entryForm.value; + if (!formValue.country ) { + this.toastr.error('Please select country'); + return; + } + // Get description from master (selectcountry) + + + + let countryname= ''; + + + + let countrydescription= ''; + + + + + if (this.selectcountry && Array.isArray(this.selectcountry)) { + + + const found = this.selectcountry.find(p => p.name === formValue.country); + + + + + + if (found && found.name) { + countryname = found.name; + } + + + + + if (found && found.description) { + countrydescription = found.description; + } + + + + } + const line = this.countrySummary.length + 1; + const orderItem = { + line: line, + + + name: countryname, // always use master description + + + + + description: countrydescription, // always use master description + + + + // unitPrice: Number(formValue.price), + // quantity: Number(formValue.quantity), + // total: Number(formValue.price) * Number(formValue.quantity) + }; + this.countrySummary.push(orderItem); + + this.countrytotal = ''; + } + + /** + * Remove item from order summary by index + */ + removecountryOrder(index: number) { + this.countrySummary.splice(index, 1); + // Recalculate line numbers + this.countrySummary.forEach((item, i) => { + item.line = i + 1; + }); + } + + /** + * Calculate subtotal of all order items + */ + getcountrySubtotal(): number { + return this.countrySummary.reduce((sum, item) => sum + item.total, 0); + } + + /** + * Calculate GST (18%) + */ + getcountryGST(): number { + return this.getcountrySubtotal() * 0.18; + } + + /** + * Calculate grand total (subtotal + GST) + */ + getcountryGrandTotal(): number { + return this.getcountrySubtotal() + this.getcountryGST(); + + } + // ================== ORDER SUMMARY LOGIC END ================== + + +// updateaction +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.service.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.service.ts new file mode 100644 index 0000000..26a1c69 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Test2service{ + private baseURL = "Test2/Test2" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + +getAllcountry(): Observable { +return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1"); } + +// updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2_cardvariable.ts new file mode 100644 index 0000000..c719226 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/testdata/Test2/Test2_cardvariable.ts @@ -0,0 +1,4 @@ +export const Test2cardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/about/about.component.html b/frontend/angular-clarity-master/src/app/modules/main/about/about.component.html new file mode 100644 index 0000000..552bb52 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/about/about.component.html @@ -0,0 +1,13 @@ + + +
+ Angular Logo +

+ Angular {{ version.full }} + and Clarity Design System 15.2.0 +

+ UX guidelines, HTML/CSS framework, and Angular components working together to craft exceptional experiences +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/about/about.component.scss b/frontend/angular-clarity-master/src/app/modules/main/about/about.component.scss new file mode 100644 index 0000000..e6d686a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/about/about.component.scss @@ -0,0 +1,15 @@ +a:link { + text-decoration: none; +} + +a:visited { + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +a:active { + text-decoration: none; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/about/about.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/about/about.component.spec.ts new file mode 100644 index 0000000..6b77344 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/about/about.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AboutComponent } from './about.component'; + +describe('AboutComponent', () => { + let component: AboutComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AboutComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AboutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/about/about.component.ts b/frontend/angular-clarity-master/src/app/modules/main/about/about.component.ts new file mode 100644 index 0000000..07e4283 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/about/about.component.ts @@ -0,0 +1,14 @@ +import { Component, OnInit, VERSION } from '@angular/core'; + +@Component({ + selector: 'app-about', + templateUrl: './about.component.html', + styleUrls: ['./about.component.scss'] +}) +export class AboutComponent implements OnInit { + version: any = VERSION; + constructor() { } + + ngOnInit() {} + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.html new file mode 100644 index 0000000..29e3819 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.html @@ -0,0 +1,18 @@ + + +
+ Image +

+ {{ 'ABOUT_TITLE' | translate }} +

+ {{ 'ABOUT_DESCRIPTION' | translate }} +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.spec.ts new file mode 100644 index 0000000..6b77344 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AboutComponent } from './about.component'; + +describe('AboutComponent', () => { + let component: AboutComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AboutComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AboutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.ts new file mode 100644 index 0000000..80c565f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/about/about.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit, VERSION } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; + +@Component({ + selector: 'app-about', + templateUrl: './about.component.html', + styleUrls: ['./about.component.scss'] +}) +export class AboutComponent implements OnInit { + version: any = VERSION; + + constructor(private translate: TranslateService) { } + + ngOnInit() {} + + switchLanguage(language: string) { + this.translate.use(language); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.html new file mode 100644 index 0000000..289c50b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.html @@ -0,0 +1,204 @@ + + + + + +
+
+

{{'accessType' | translate}}

+
+
+ + +
+
+ + + + Loading ... +
{{error}}
+ + {{'name' | translate}} + {{'default' | translate}} + {{'description' | translate}} + + + + + {{user.name}} + + {{user.description}} + + + + + + + + + + + + {{'usersPerPage' | translate}} + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + {{'of' | translate}} {{pagination.totalItems}} {{'users' | translate}} + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.scss new file mode 100644 index 0000000..d3cd6e7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.scss @@ -0,0 +1,62 @@ +input[type=text],[type=date],[type=password] { + width: 100%; + padding: 15px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + //background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.spec.ts new file mode 100644 index 0000000..5c4bf19 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AccesstypeComponent } from './accesstype.component'; + +describe('AccesstypeComponent', () => { + let component: AccesstypeComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AccesstypeComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AccesstypeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.ts new file mode 100644 index 0000000..a54048d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.ts @@ -0,0 +1,189 @@ +import { Component, OnInit } from '@angular/core'; +import { Form, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; + +@Component({ + selector: 'app-accesstype', + templateUrl: './accesstype.component.html', + styleUrls: ['./accesstype.component.scss'] +}) +export class AccesstypeComponent implements OnInit { + loading = false; + selected: any[] = []; + rowSelected: any = {}; + modaldelete = false; + modalAdd = false; + modaledit = false; + moduleAdd = false; + error; + data; + module; + moduledata; + submitted = false; + selected1 = "true"; + public entryForm: FormGroup; + public mentryForm: FormGroup; + constructor(private _fb: FormBuilder, private toastr: ToastrService, + private router: Router, private accesstype: AccesstypeService, + private route: ActivatedRoute, + ) { } + + ngOnInit(): void { + this.entryForm = this._fb.group({ + + name: ['', [Validators.required]], + defaultvalue: ['', [Validators.required]], + description: ['', [Validators.required]], + + }); + this.mentryForm = this._fb.group({ + modulename: [null], + }) + this.getdata(); + this.getdata1(); + } + getdata() { + this.accesstype.getAll().subscribe(resp => { + this.data = resp; + console.log('menus: ', this.data); + if (this.data.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) + } + getdata1() { + this.accesstype.getAll1().subscribe(resp => { + this.moduledata = resp; + console.log('menus: ', this.moduledata); + if (this.moduledata.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) + } + goToAdd() { + this.modalAdd = true; + } + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } + console.log(this.entryForm.value); + this.accesstype.create(this.entryForm.value).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Added successfully'); + } + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not added Data Getting Some Error'); + } + this.ngOnInit(); + + }); + this.modalAdd = false; + } + goToEdit(row) { + this.rowSelected = row; + console.log(row) + this.modaledit = true; + //this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.accesstype.delete(id).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Deleted successfully'); + } + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + this.ngOnInit(); + }); + + } + onUpdate(id) { + this.modaledit = false; + this.accesstype.update(id, this.rowSelected).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Updated successfully'); + } + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not updated Data Getting Some Error'); + } + this.ngOnInit(); + }); + } + goTomodules() { + this.router.navigate(["../acmodules"], { relativeTo: this.route }); + } + accessid; + gomodules(row) { + this.rowSelected = row; + this.moduleAdd = true; + this.accessid = row.id + this.getallidmodules(this.accessid) + } + moduledata1; + getallidmodules(id) { + this.accesstype.getById(id).subscribe((data) => { + console.log(data); + this.moduledata1 = data; + if (this.moduledata1.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }) + } + addmodules(id) { + console.log(this.mentryForm.value); + this.accesstype.addById(id, this.mentryForm.value).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success("Added Successfully"); + } + this.ngOnInit(); + }, (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Added Data Getting Some Error'); + } + this.ngOnInit(); + }) + this.moduleAdd = false; + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.html new file mode 100644 index 0000000..fce1d94 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.html @@ -0,0 +1,128 @@ + + + + +
+
+ +
+ + +
+
+ + + + + + + + + data not found! + + + NO + + + Structure ID + + + Structure Name + + + Structure Seq + + + + + + {{i+1}} + {{user.StructureID}} + {{user.StructureName}} + {{user.StructureSeq}} + + + + + + + + + + + + + + + + +
StructureName{{user.StructureName}}
+
+
+ + + + Record per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} Records + + +
+
+ + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.scss new file mode 100644 index 0000000..36abb8c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.scss @@ -0,0 +1 @@ +@import '../../../../../styles1.scss'; diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.spec.ts new file mode 100644 index 0000000..7fde7a8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DocumentmasterComponent } from './documentmaster.component'; + +describe('DocumentmasterComponent', () => { + let component: DocumentmasterComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DocumentmasterComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DocumentmasterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.ts new file mode 100644 index 0000000..4779866 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentmaster/documentmaster.component.ts @@ -0,0 +1,30 @@ +import { Component, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { ExcelService } from '../../../../services/excel.service'; +import * as moment from 'moment'; +@Component({ + selector: 'app-documentmaster', + templateUrl: './documentmaster.component.html', + styleUrls: ['./documentmaster.component.scss'] +}) +export class DocumentmasterComponent implements OnInit { + loading = false; + public entryForm: FormGroup; + givendata; + orders; + modalAdd= false; + modaledit=false; + rowSelected :any= {}; + constructor(private excel: ExcelService,) { } + + ngOnInit(): void { + } + onExport() { + this.excel.exportAsExcelFile(this.givendata, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + goToAdd() { + this.modalAdd=true; + //this.router.navigate(["../usermaintanceadd"],{relativeTo:this.route}); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.html new file mode 100644 index 0000000..db3c0eb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.html @@ -0,0 +1,180 @@ + + + + +
+
+ +
+ + +
+
+ + + + + + + + + data not found! + + + NO + + + Document Code + + + Pad Zero + + + Start With + + + Last Number + + + Max Length + + + Structure ID + + + + + {{i+1}} + {{user. DocumentCode}} + {{user. PadZero}} + {{user. StartWith}} + {{user. LastNumber}} + {{user. MaxLength}} + {{user. StructureID}} + + + + + + + + + + + + + + + + +
StructureID{{user. StructureID}}
+
+
+ + + + Record per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} Records + + +
+
+ + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.scss new file mode 100644 index 0000000..36abb8c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.scss @@ -0,0 +1 @@ +@import '../../../../../styles1.scss'; diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.spec.ts new file mode 100644 index 0000000..18b137e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DocumentreferenceComponent } from './documentreference.component'; + +describe('DocumentreferenceComponent', () => { + let component: DocumentreferenceComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DocumentreferenceComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DocumentreferenceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.ts new file mode 100644 index 0000000..5678564 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentreference/documentreference.component.ts @@ -0,0 +1,30 @@ +import { Component, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { ExcelService } from '../../../../services/excel.service'; +import * as moment from 'moment'; +@Component({ + selector: 'app-documentreference', + templateUrl: './documentreference.component.html', + styleUrls: ['./documentreference.component.scss'] +}) +export class DocumentreferenceComponent implements OnInit { + loading = false; + public entryForm: FormGroup; + givendata; + orders; + modalAdd= false; + modaledit=false; + rowSelected :any= {}; + constructor(private excel: ExcelService,) { } + + ngOnInit(): void { + } + onExport() { + this.excel.exportAsExcelFile(this.givendata, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + goToAdd() { + this.modalAdd=true; + //this.router.navigate(["../usermaintanceadd"],{relativeTo:this.route}); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.html new file mode 100644 index 0000000..dae85a6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.html @@ -0,0 +1,56 @@ + +
+
+
+ +
+ For Structure ID + +
+
+ + + + + + No Result Found + No + Seq + Prefix + Type + Delete + + + + + + + + + users + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.spec.ts new file mode 100644 index 0000000..0f200c4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DocumentstructureComponent } from './documentstructure.component'; + +describe('DocumentstructureComponent', () => { + let component: DocumentstructureComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DocumentstructureComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DocumentstructureComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.ts new file mode 100644 index 0000000..2117853 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/documentstructure/documentstructure.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-documentstructure', + templateUrl: './documentstructure.component.html', + styleUrls: ['./documentstructure.component.scss'] +}) +export class DocumentstructureComponent implements OnInit { + loading = false; + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.html new file mode 100644 index 0000000..4b1d101 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.html @@ -0,0 +1,1057 @@ + + +
+
+
+

User list

+
+
+ + + +
+
+ + + user not found! + + + Menu Name + + + + + Description + + + + + Enabled + + + + + Start Date + + + + + End Date + + + + + + {{user.menu_name}} + {{user.description}} + {{user.active}} + {{user.start_date_1}} + {{user.end_date_1}} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Menu Name: {{user.menu_name}} +
Description: {{user.description}}
Enabled: {{user.active}}
Default End Date: 10/03/2001 Start Date: {{user.start_date_1}}
Default End Date: 10/03/2001 End Date: {{user.end_date_1}}
+ + + + + + + + + + + + + + + + + + + +
Sr. NoNameTypeMenu NameActive
{{ i + 1 }}{{ line.name }}{{ line.type }} {{ line.menu_name }} {{ line.active }}
+ + +
+
+ + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.scss new file mode 100644 index 0000000..76ae2bd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.scss @@ -0,0 +1,65 @@ +// // @import '../../../../assets/scss/var'; +// .s-info-bar { +// display: flex; +// flex-direction: row; +// justify-content: space-between; +// button { +// outline: none; +// } +// } + +// .grid-pg { +// width:750px; +// } + + +// #add { +// position: absolute; +// //position: fixed; +// transition: .5s ease; +// top: 16%; +// left: 79%; +// } + +input[type=text],[type=date], select { + width: 100%; + padding: 12px 20px; + margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + .required-field{ + color: red; + + } + .horizontal{ + width: 50%; + padding: 10px; + } + + .td-title { + text-align: center; + color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); + } + th{ + background-color:rgb(170, 169, 169); + font-weight: bold; + } + .td-content{ + text-align: left; + } + .delete,.heading{ + text-align: center; + color: red; + } + .section p { + background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.ts new file mode 100644 index 0000000..83594c5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/all/all-menu-group.component.ts @@ -0,0 +1,506 @@ +import { Component, OnInit, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core'; +import { MenuGroupService } from '../../../../../services/admin/menu-group.service'; +import { MenuRegisterService } from '../../../../../services/admin/menu-register.service'; + +import { ToastrService } from 'ngx-toastr'; +import { university } from '../../../../../models/fnd/university'; +import { AlertService } from '../../../../../services/alert.service'; +import { UniversityService } from 'src/app/services/admin/university.service'; +import { ExcelService } from '../../../../../services/excel.service'; +import * as moment from 'moment'; +import { FormArray, FormBuilder, FormGroup } from '@angular/forms'; +import { HttpErrorResponse } from '@angular/common/http'; +import { ActivatedRoute, Router } from '@angular/router'; + +@Component({ + selector: 'app-all-menu-group', + templateUrl: './all-menu-group.component.html', + styleUrls: ['./all-menu-group.component.scss'], +}) +export class AllMenuGroupComponent implements OnInit { + + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + + loading = false; + university; + modalOpenedforNewLine = false; + newLine: university = new university(); + + hname = ['ashwini', 'akash', 'satyam', 'ganesh', 'krishna']; + + email = ['a@gmail.com', 'b@gmail.com', 'c@gmail.com', 'd@gmail.com', 'k@gmail.com']; + + subject = ['marathi', 'hindi', 'english']; + + booktype = ['maths', 'language', 'science']; + + bookname: string[] = ['rich dad poor dad', 'The one thing', 'The momb who head farai', 'trump', 'lucky', 'syamchi aai', + 'aai', 'ek hota karwar', 'chawa', 'mutunjay', 'duniyadari', 'dad', + 'story book', 'horror story', 'poem']; + + writer = ['true', 'false']; + + + price = ['100', '200']; + + basic: boolean = false; + + id: number; + submitted = false; + currentUrl = ""; + selected: any[] = []; + + constructor( + private _mg: MenuGroupService, + private _mr: MenuRegisterService, + private mainService: UniversityService, + private alertService: AlertService, + private toastr: ToastrService, + private excel: ExcelService, + private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + ) { + + } + + ngOnInit() { + + this.getData(); + + } + getData() { + this._mg.getAll().subscribe((data) => { + console.log(data); + this.university = data; + this.university = this.university.items; + console.log(this.university); + + }); + + this.entryForm = this._fb.group({ + menu_name: [null], + description: [null], + active: [null], + start_date_1: [null], + end_date_1: [null], + start_date: [null], + end_date: [null], + + + menu_group_lines: this._fb.array([this.initLinesForm()]), + + + + }); + + } + + initLinesForm() { + return this._fb.group({ + + menu_id: 23, + menu_name: [null], + name: [null], + active: [null], + seq: 32, + type: [null], + + }); + } + + onEdit(row) { + this.rowSelected = row; + console.log(this.rowSelected); + + this.modalEdit = true; + } + + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + // this.mainService.delete(id).subscribe( + // (data) => { + // console.log(data); + + // this.ngOnInit(); + + // }, + // ); + + this._mg.deleteById(id).subscribe( + (data: any)=>{ + console.log('Deletion success...'); + this.ngOnInit(); + } + ); + if (id) { + this.toastr.success('Deleted successfully'); + } + + } + + onUpdate(id) { + this.modalEdit = false; + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + // this.mainService.update(id, this.rowSelected).subscribe( + // (data) => { + // console.log(data); + + // }, + + // ); + this._mg.updateGroupHeader(id, this.rowSelected).subscribe( + (data: any)=>{ + console.log(data); + console.log('Update Success...'); + this.modalEdit = false; + this.ngOnInit(); + + }, + (error: any)=>{ + console.log(error); + + } + ); + if (id) { + this.toastr.success('Updated successfully'); + } + + } + onExport() { + this.excel.exportAsExcelFile(this.university, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + goToAdd(row) { + + this.modalAdd = true; + + } + onSubmit() { + + + + //console.warn("calling submit"); + + //console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } + this.onCreate(); + } + + + + onCreate() { + this.modalAdd = false; + + this._mg.addToDb(this.entryForm.value).subscribe( + (data: any)=>{ + console.log(data); + this.ngOnInit(); + }, + (error: any)=>{ + console.log(error); + + } + ); + if (this.entryForm.value) { + this.toastr.success('Added successfully'); + + } + } + + get controls() { + return (this.entryForm.get("menu_group_lines") as FormArray).controls; + } + + onRemoveLines(index: number) { + (this.entryForm.get("menu_group_lines")).removeAt(index); + } + onAddLines() { + (this.entryForm.get("menu_group_lines")).push(this.initLinesForm()); + } + update() { + this.mainService.update(this.id, this.university).subscribe( + (data) => { + console.log(data); + + }, + (error: HttpErrorResponse) => { + console.log(error.message); + } + ); + } + +} + + + + + + +// import { Component, OnInit, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core'; +// import { MenuGroupService } from 'src/app/services/api/menu-group.service'; +// import { MenuRegisterService } from 'src/app/services/api/menu-register.service'; + + +// @Component({ +// selector: 'app-all-menu-group', +// templateUrl: './all-menu-group.component.html', +// styleUrls: ['./all-menu-group.component.scss'], +// encapsulation: ViewEncapsulation.Emulated +// }) +// export class AllMenuGroupComponent implements OnInit { +// @ViewChild('getById') selectById: TemplateRef; +// @ViewChild('txId') txId: TemplateRef; +// basic: boolean = false; +// columns: any[]; +// rows: any[]; +// temp = []; + +// filterData: string; +// isLoading: boolean = false; + +// modalEdit: false; +// loading = false; +// openEdit = false; +// openAdd = false; +// openAddLine = false; +// openEditHeader = false; + +// mgdata: any; +// linesData: Array; +// lines = []; + +// updata = { +// id: '', +// active: '', +// createdAt: '', +// createdBy: '', +// description: '', +// end_date: '', +// end_date_1: '', +// menu_name: '', +// start_date: '', +// start_date_1: '', +// updatedAt: '', +// updatedBy: '', +// menu_group_lines: [ +// { +// id: '', +// active: '', +// createdAt: '', +// createdBy: '', +// menu_id: '', +// manu_name: '', +// name: '', +// seq: '', +// type: '', +// updatedAt: '', +// updatedBy: '' +// }, +// ], +// } + +// updateHeader = { +// id: '', +// active: '', +// createdAt: '', +// createdBy: '', +// description: '', +// end_date: '', +// end_date_1: '', +// menu_name: '', +// start_date: '', +// start_date_1: '', +// updatedAt: '', +// updatedBy: '', +// } + +// menu_group_line = +// { +// id: '', +// menu_id: '', +// menu_name: '', +// name: '', +// active: '', +// seq: '', +// type: '', +// menu_group_header: { +// id: '' +// } +// } + +// headerAdd = { +// menu_name: '', +// description: '', +// active: false, +// start_date_1: '', +// end_date_1: '' +// } + +// lineAdd = { +// name: '', +// menu_name: '', +// active: false, +// type: '', +// menu_group_header: { +// id: '' +// } +// } + +// constructor( +// private _mg: MenuGroupService, +// private _mr: MenuRegisterService +// ) { +// this.linesData = new Array(); +// } + +// ngOnInit() { + +// this._mg.getAll().subscribe( +// (data: any) => { +// this.mgdata = data; +// console.log(this.mgdata); + +// } +// ); + +// } + +// addData() { +// console.log(this.headerAdd); +// this._mg.addToDb(this.headerAdd).subscribe( +// (data: any) => { +// console.log('Data addedd successfully...'); +// this.openAdd = false; +// this.ngOnInit(); +// }, +// (error: any) => { +// console.log(error); + +// } + +// ); +// } + +// openAddLinef(id: any) { +// this.openAddLine = true; +// console.log(id); +// this.lineAdd.menu_group_header.id = id; + + +// } +// saveD() { +// console.log(this.lineAdd); +// this._mg.addLineToDb(this.lineAdd).subscribe( +// (data: any) => { +// console.log('data added success...'); +// this.openAddLine = false; +// this.ngOnInit(); +// }, +// (error: any) => { +// console.log(error); + +// } +// ); +// } + +// openEditGroup(id: any) { +// this.openEdit = true; +// console.log(id); +// this._mg.getOneById(id).subscribe( +// (data: any) => { +// this.updata = data; +// this.lines = this.updata.menu_group_lines; +// for(let val of this.updata.menu_group_lines){ +// this.linesData.push(val); +// } +// console.log('New Data of Lines : '); +// console.log(this.lines); +// }, +// (error: any) => { +// console.log(error); + +// } +// ); + +// } + +// perfUpdate(){ +// console.log(this.updata); +// this.updateHeader.id = this.updata.id; +// this.updateHeader.active = this.updata.active; +// this.updateHeader.createdAt = this.updata.createdAt; +// this.updateHeader.createdBy = this.updata.createdBy; +// this.updateHeader.description = this.updata.description; +// this.updateHeader.end_date = this.updata.end_date; +// this.updateHeader.end_date_1 = this.updata.end_date_1; +// this.updateHeader.menu_name = this.updata.menu_name; +// this.updateHeader.start_date = this.updata.start_date; +// this.updateHeader.start_date_1 = this.updata.start_date_1; +// this.updateHeader.updatedAt = this.updata.updatedAt; +// this.updateHeader.updatedBy = this.updata.updatedBy; + +// this._mg.updateGroupHeader(this.updateHeader.id, this.updateHeader).subscribe( +// (datah: any)=>{ +// console.log('Data(header) updated successsfully...'); +// console.log(datah); + +// for(let val of this.lines){ +// this.menu_group_line.id = val.id; +// this.menu_group_line.menu_id = val.menu_id; +// this.menu_group_line.menu_name = val.menu_name; +// this.menu_group_line.name = val.name; +// this.menu_group_line.seq = val.seq; +// this.menu_group_line.type = val.type; +// // this.menu_group_line.menu_group_header.id = datah.id; +// this.menu_group_line.menu_group_header.id = this.updateHeader.id; + +// this._mg.updateLineById(this.menu_group_line).subscribe( +// (data: any)=>{ +// console.log('Data(Line) Updated Successfully...'); +// console.log(data); +// this.linesData = []; +// this.openEdit = false; +// this.ngOnInit(); +// console.log(this.linesData); + +// }, +// (error: any)=>{ +// console.log(error); + +// } +// ); +// } +// }, +// (error: any)=>{ +// console.log(error); + +// } +// ); +// } + +// closeM(){ +// this.openEdit = false; +// this.linesData = []; +// } + + + +// } + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.component.html new file mode 100644 index 0000000..75220a5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.component.html @@ -0,0 +1,99 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.component.ts new file mode 100644 index 0000000..2ba68dc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.component.ts @@ -0,0 +1,97 @@ +import { Component, OnInit } from "@angular/core"; +import { ActivatedRoute, Router } from "@angular/router"; +import { HttpClient, HttpErrorResponse } from "@angular/common/http"; +// import { Rn_Menu_Group_Line } from "src/app/models/Rn_Menu_Group_Line"; +// import { Rn_Menu_Group_Header } from "src/app/models/Rn_Menu_Group_Header"; +// import { MenuGroupService } from "src/app/services/api/menu-group.service"; +// import { MenuRegisterService } from "src/app/services/api/menu-register.service"; + +@Component({ + selector: "edit-menu-group", + templateUrl: "./edit-menu-group.component.html", + styleUrls: ["./edit-menu-group.scss"], +}) +export class EditMenuGroupComponent implements OnInit { + updated = false; + // rn_menu_group_header: Rn_Menu_Group_Header; + // rn_menu_group_line: Rn_Menu_Group_Line[]; + id: number; + + types = ['user', 'admin', 'mis report', 'bi report']; + + constructor( + private router: Router, + private route: ActivatedRoute, + // private menuRegisterService: MenuRegisterService, + // private menuGroupService: MenuGroupService + ) {} + + ngOnInit() { + //this.getMapings(); + + // this.rn_menu_group_header = new Rn_Menu_Group_Header(); + // this.id = this.route.snapshot.params["id"]; + // console.log("update with id = ", this.id); + // this.getById(this.id); + } + +// getById(id: number) { +// this.menuGroupService.getById(id).subscribe((data) => { +// this.rn_menu_group_header = data; +// this.rn_menu_group_line = data.menu_group_lines; +// }); +// } + +// update() { +// this.menuGroupService.update(this.id, this.rn_menu_group_header).subscribe( +// (resp) => { +// console.log(resp); +// this.router.navigate(["../../all"], { relativeTo: this.route }); +// }, +// (error: HttpErrorResponse) => { +// console.log(error.message); +// } +// ); +// this.rn_menu_group_header = new Rn_Menu_Group_Header(); +// } + +// onSubmit() { +// this.updated = true; +// this.update(); +// } + +// /* getMapings() { +// this.httpService +// .get('./assets/json/form-setup-mapping.json') +// .subscribe(data => { +// console.log(data); +// this.mappings = data; +// }, err => console.log(err) +// ) +// } */ + +// menuDate: any[]; +// menuDropDown: any[]; +// getMenuData() { +// //this.menuRegisterService.getAll().subscribe((data) => { +// this.menuRegisterService.getByAccountId().subscribe((data) => { +// this.menuDate = data; +// console.log('Menu List by Account Id : ', this.menuDate); +// const keys = this.menuDate.map((item) => { +// const container = {id: '', name: ''}; +// container.id = item.id; +// container.name = item.main_menu_name; +// return container; +// }); +// console.log('Menu dropdown: ', keys); +// this.menuDropDown = keys; +// }, (err) => { +// console.log(err) +// } +// ); +// } + +// back() { +// this.router.navigate(["../../all"], { relativeTo: this.route }); +// } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.scss new file mode 100644 index 0000000..ffe3733 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/edit/edit-menu-group.scss @@ -0,0 +1,51 @@ +// @import '../../../../assets/scss/var'; + +.s-info-bar{ + display:flex; + flex-direction: row; + justify-content:space-between; + button{outline:none;} +} + +.edit-pg { + width:750px; +} + +#lines { + table, th, td { + border: 0.5px solid #f1f0f0; + border-collapse: collapse; + } + input, input :focus { + //-webkit-appearance: none; + outline: none; + border-width:0px; + border:none; + } +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} + +$bg-color: #dddddd; +.section { + background-color: $bg-color; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/menu-group.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/menu-group.component.html new file mode 100644 index 0000000..0680b43 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/menu-group.component.html @@ -0,0 +1 @@ + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/menu-group.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/menu-group.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/menu-group.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/menu-group.component.ts new file mode 100644 index 0000000..fb6833d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/menu-group.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit, ViewEncapsulation } from '@angular/core'; + +@Component({ + selector: 'app-menu-group', + templateUrl: './menu-group.component.html', + styleUrls: ['./menu-group.component.scss'], + // encapsulation: ViewEncapsulation.Emulated +}) +export class MenuGroupComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.component.html new file mode 100644 index 0000000..54ee5b7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.component.html @@ -0,0 +1,94 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.component.ts new file mode 100644 index 0000000..9d0ad17 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.component.ts @@ -0,0 +1,44 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +// import { Rn_Forms_Setup } from 'src/app/models/Rn_Forms_Setup'; +// import { FormSetupService } from 'src/app/services/api/form-setup.service'; +// import { Rn_Menu_Group_Header } from 'src/app/models/Rn_Menu_Group_Header'; +// import { MenuGroupService } from 'src/app/services/api/menu-group.service'; + +@Component({ + selector: 'readonly-menu-group', + templateUrl: './readonly-menu-group.component.html', + styleUrls: [ './readonly-menu-group.scss'], +}) +export class ReadOnlyMenuGroupComponent implements OnInit { + basic: boolean = false; + id: number; + // rn_menu_group_header: Rn_Menu_Group_Header; + constructor( + private router: Router, + private route: ActivatedRoute, + // private menuGroupService: MenuGroupService + ) { } + + ngOnInit() { + // this.getById(); + } + + // getById() { + // this.rn_menu_group_header = new Rn_Menu_Group_Header(); + // this.id = this.route.snapshot.params['id']; + // this.menuGroupService.getById(this.id) + // .subscribe(data => { + // console.log(data); + // this.rn_menu_group_header = data; + // }); + // } + + // goToWhoColumns() { + // this.basic = !this.basic; + // } + + // back() { + // this.router.navigate(['../../all'], {relativeTo: this.route}); + // } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.scss new file mode 100644 index 0000000..3036f69 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-group/read-only/readonly-menu-group.scss @@ -0,0 +1,23 @@ +// @import '../../../../assets/scss/var'; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} + +.read-only-pg { + width:750px; +} + + + +#build_btn { + position: absolute; + transition: .5s ease; + top: 404px; + left: 644px; +} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.html new file mode 100644 index 0000000..0e3e30e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.html @@ -0,0 +1 @@ +

add-menur works!

diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.spec.ts new file mode 100644 index 0000000..fccbe61 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddMenurComponent } from './add-menur.component'; + +describe('AddMenurComponent', () => { + let component: AddMenurComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AddMenurComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AddMenurComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.ts new file mode 100644 index 0000000..c24e5f3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/add-menur/add-menur.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-add-menur', + templateUrl: './add-menur.component.html', + styleUrls: ['./add-menur.component.scss'] +}) +export class AddMenurComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.html new file mode 100644 index 0000000..6c134ab --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.html @@ -0,0 +1,203 @@ + + +
+
+
+

menu register

+
+
+ + +
+
+ + user not found! + + + Sr. No + + + + + Menu Name + + + + + Action Link + + + + + Menu Icon + + + + + Flag + + + + + End Date + + + + + {{i + 1}} + {{user.main_menu_name}} + {{user.main_menu_action_name}} + {{user.main_menu_icon}} + {{user.enable_flag}} + {{user.end_date_1}} + + + + ˝ + + + + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + + +
+ + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.scss new file mode 100644 index 0000000..4f6d7c9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.scss @@ -0,0 +1,14 @@ +input[type=text],[type=date], select { + width: 100%; + padding: 12px 20px; + margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .delete,.heading{ + text-align: center; + color: red; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.spec.ts new file mode 100644 index 0000000..620106c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AllMenurComponent } from './all-menur.component'; + +describe('AllMenurComponent', () => { + let component: AllMenurComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AllMenurComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AllMenurComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.ts new file mode 100644 index 0000000..67ea77d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/all-menur/all-menur.component.ts @@ -0,0 +1,187 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { MenuGroupService } from '../../../../../services/admin/menu-group.service'; +import { MenuRegisterService } from '../../../../../services/admin/menu-register.service'; + +@Component({ + selector: 'app-all-menur', + templateUrl: './all-menur.component.html', + styleUrls: ['./all-menur.component.scss'] +}) +export class AllMenurComponent implements OnInit { + + basic: boolean = false; + columns: any[]; + rows: any[]; + temp = []; + selected: any[] = []; + filterData: string; + isLoading: boolean = false; + + modalEdit: false; + loading = false; + + openEdit = false; + openAdd = false; + + modaldelete = false; + tempid: any; + + regData: any; + + addReg = { + main_menu_name: '', + main_menu_action_name: '', + main_menu_icon: '', + enable_flag: false, + end_date_1: '' + } + + upReg = { + id: '', + main_menu_name: '', + main_menu_action_name: '', + main_menu_icon: '', + enable_flag: '', + end_date_1: '' + } + + line = { + id: '', + menu_id: '', + menu_name: '', + name: '', + active: true, + seq: '', + type: '', + menu_group_header: { + id: 5, + } + }; + + lenReg: any; + + constructor( + private _mr: MenuRegisterService, + private _mg: MenuGroupService, + private toastr: ToastrService, + ) { } + + ngOnInit(): void { + + this._mr.getd().subscribe( + (data: any) => { + this.regData = data.items; + this.lenReg = this.regData.length; + console.log(this.regData); + console.log(this.lenReg); + + + } + ); + + + } + + saveData() { + console.log(this.addReg); + + this._mr.add(this.addReg).subscribe( + (data: any) => { + console.log('Data Success...'); + + this.line.menu_id = data.id; + this.line.active = true; + this.line.type = 'admin'; + // this.line.menu_group_header.id = '5'; + + this._mr.getd().subscribe( + (data: any)=>{ + this.lenReg = data.length; + } + ); + + this.line.seq = this.lenReg + 1; + + this._mg.addLineToDb(this.line).subscribe( + (data: any)=>{ + console.log('both success..'); + + }, + (error: any)=>{ + console.log(error); + + } + ); + + this.openAdd = false; + this.addReg = { + main_menu_name: '', + main_menu_action_name: '', + main_menu_icon: '', + enable_flag: false, + end_date_1: '' + }; + this.ngOnInit(); + this.toastr.success('Added successfully'); + }, + (error: any) => { + console.log(error); + + } + ); + } + + editReg(id: any) { + this.openEdit = true; + console.log(id); + this._mr.getById(id).subscribe( + (data: any) => { + this.upReg = data; + console.log(this.upReg); + }, + (error: any) => { + console.log(error); + } + ); + } + + performup() { + this._mr.update(this.upReg.id, this.upReg).subscribe( + (data: any) => { + console.log('updation success...'); + this.toastr.success('Updated successfully'); + this.openEdit = false; + this.ngOnInit(); + + }, + (error: any) => { + console.log(error); + + } + ); + } + + delete(id: any) { + this.tempid = id; + this.modaldelete = true; + + } + + del() { + console.log('Id of row u clicked is : ' + this.tempid); + this._mr.deleteById(this.tempid).subscribe( + (data: any) => { + console.log('Deletion successful..'); + this.ngOnInit(); + this.modaldelete = false; + this.toastr.success('Deleted successfully'); + }, + (error: any) => { + console.log(error); + + } + ); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.html new file mode 100644 index 0000000..862db5a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.html @@ -0,0 +1 @@ +

edit-menur works!

diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.spec.ts new file mode 100644 index 0000000..cf744ca --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditMenurComponent } from './edit-menur.component'; + +describe('EditMenurComponent', () => { + let component: EditMenurComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ EditMenurComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(EditMenurComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.ts new file mode 100644 index 0000000..7f5dcf8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/edit-menur/edit-menur.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-edit-menur', + templateUrl: './edit-menur.component.html', + styleUrls: ['./edit-menur.component.scss'] +}) +export class EditMenurComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.html new file mode 100644 index 0000000..0680b43 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.html @@ -0,0 +1 @@ + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.spec.ts new file mode 100644 index 0000000..3b21b1f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MenuRegisterComponent } from './menu-register.component'; + +describe('MenuRegisterComponent', () => { + let component: MenuRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MenuRegisterComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MenuRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.ts new file mode 100644 index 0000000..e8e3459 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/menu-register.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-menu-register', + templateUrl: './menu-register.component.html', + styleUrls: ['./menu-register.component.scss'] +}) +export class MenuRegisterComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.html new file mode 100644 index 0000000..2c0eda0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.html @@ -0,0 +1 @@ +

readonly-menur works!

diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.spec.ts new file mode 100644 index 0000000..efe0482 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReadonlyMenurComponent } from './readonly-menur.component'; + +describe('ReadonlyMenurComponent', () => { + let component: ReadonlyMenurComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReadonlyMenurComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReadonlyMenurComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.ts new file mode 100644 index 0000000..bf58eb2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menu-register/readonly-menur/readonly-menur.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-readonly-menur', + templateUrl: './readonly-menur.component.html', + styleUrls: ['./readonly-menur.component.scss'] +}) +export class ReadonlyMenurComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.html new file mode 100644 index 0000000..fb96a15 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.html @@ -0,0 +1,465 @@ + + +
+
+
+ +
+
+

{{'MENU_ACCESS_CONTROL' | translate}}

+

{{'SECURITY' | translate}}

+
+
+
+ {{'EDIT_MODE' | translate}} +
+ + + +
+ {{'SHOW_ALL' | translate}} + {{'ONLY_MAIN_MENU' | translate}} + +
+
+
+ +
+
+
+ +
+ {{'CLOSE_TOGGLE_TO_ACTIVATE_ADD_BUTTON' | translate}} +
+
+
+ +
+
+ +
+
+
+
{{ totalItems }}
+
{{'TOTAL_ITEMS' | translate}}
+
+
+
{{ mainMenuCount }}
+
{{'MAIN_MENUS' | translate}}
+
+
+
{{ subMenuCount }}
+
{{'SUB_MENUS' | translate}}
+
+
+
+ + + + + {{'LOADING' | translate}} ... + +
{{'NO_DATA_AVAILABLE' | translate}}
+
+ + + + + {{'NO' | translate}} + + + + + + + {{'MENU_ITEM_NAME' | translate}} + + + + + + + {{'VIEW' | translate}} + + + + + + + {{'CREATE' | translate}} + + + + + + + {{'EDIT' | translate}} + + + + + + + {{'DELETE' | translate}} + + + + + + + {{'QUERY' | translate}} + + + + + + + {{'EXPORT' | translate}} + + + + + + {{i+1}} + + {{all.menuItemDesc}} + +    {{all.menuItemDesc}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{'MENUNAME' | translate}}
+
+
+ + + + {{'RECORDS_PER_PAGE' | translate}} + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + {{'OF' | translate}} {{pagination.totalItems}} {{'RECORDS' | translate}} + + +
+ + + + + {{'LOADING' | translate}} ... + +
{{'NO_DATA_AVAILABLE' | translate}}
+
+ + + + + {{'NO' | translate}} + + + + + + + {{'MENU_ITEM_NAME' | translate}} + + + + + + + {{'VIEW' | translate}} + + + + + + + {{'CREATE' | translate}} + + + + + + + {{'EDIT' | translate}} + + + + + + + {{'DELETE' | translate}} + + + + + + + {{'QUERY' | translate}} + + + + + + + {{'EXPORT' | translate}} + + + + + + {{i+1}} + + {{all.menuItemDesc}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{'MENUNAME' | translate}}
+
+
+
+ + + {{'RECORDS_PER_PAGE' | translate}} + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + {{'OF' | translate}} {{pagination.totalItems}} {{'RECORDS' | translate}} + + +
+ + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.scss new file mode 100644 index 0000000..4446200 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.scss @@ -0,0 +1,777 @@ +@import '../../../../../styles/_design-tokens.scss'; + +// Import base styles +input[type=text], +[type=date], +[type=password], +[type=checkbox] { + width: 100%; + padding: 15px 20px; + background-color: var(--theme-surface); + display: inline-block; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + box-sizing: border-box; + font-family: var(--theme-font-primary); + color: var(--theme-text); +} + +input[type=text]:focus, +[type=date]:focus, +[type=password]:focus, +[type=checkbox]:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); +} + +.required-field { + color: var(--theme-error, #ef4444); + font-size: 18px; +} + +.td-title { + text-align: center; + width: 150px; + color: white; + font-weight: bold; + background-color: var(--theme-primary); +} + +th { + font-weight: bold; +} + +.td-content { + text-align: left; +} + +// Modern Button Styles using ThemeService +.mac-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + font-size: 14px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; + + &:focus { + outline: 2px solid var(--theme-primary); + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + // Sizes + &.mac-btn-sm { + padding: 8px 16px; + font-size: 13px; + height: 32px; + } + + &.mac-btn-md { + padding: 12px 20px; + font-size: 14px; + height: 40px; + } + + &.mac-btn-lg { + padding: 16px 24px; + font-size: 16px; + height: 48px; + } + + // Variants + &.mac-btn-primary { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-color: var(--theme-primary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: linear-gradient(135deg, var(--theme-primary, #0284c7) 0%, var(--theme-accent, #7c3aed) 100%); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + + &:active { + transform: translateY(0); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + } + + &.mac-btn-outline { + background: transparent; + color: var(--theme-secondary); + border-color: var(--theme-secondary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: rgba(100, 116, 139, 0.1); + border-color: var(--theme-secondary); + color: var(--theme-secondary); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.mac-btn-error { + background: var(--theme-error, #ef4444); + color: white; + border-color: var(--theme-error, #ef4444); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.1); + } + } + + &.mac-btn-ghost { + background: transparent; + color: var(--theme-text-secondary); + border-color: transparent; + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } + } +} + +//toggle button +.switch { + position: relative; + display: inline-block; + width: 60px; + height: 34px; +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + -webkit-transition: .4s; + transition: .4s; +} + +.slider:before { + position: absolute; + content: ""; + height: 26px; + width: 26px; + left: 4px; + bottom: 4px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked+.slider { + background-color: var(--theme-primary); +} + +input:focus+.slider { + box-shadow: 0 0 1px var(--theme-primary); +} + +input:checked+.slider:before { + -webkit-transform: translateX(26px); + -ms-transform: translateX(26px); + transform: translateX(26px); +} + +.slider.round { + border-radius: 34px; +} + +.slider.round:before { + border-radius: 50%; +} + +// Modern themed enhancements (ThemeService variables) +.mm-breadcrumb { + color: var(--theme-text-secondary); +} + +.mac-header-left { + display: flex; +} + +.mac-title h4 { + font-weight: 300; +} + +.mac-edit-chip { + margin-top: 27px; + position: relative; +} + +.mac-chip { + display: inline-flex; + align-items: center; + padding: 6px 12px; + background-color: var(--theme-background); + color: var(--theme-text); + border-radius: var(--theme-border-radius); + font-size: 14px; + font-weight: 500; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.mac-header-right { + text-align: right; +} + +.mac-select { + height: 40px; + padding: 8px 12px; + background: var(--theme-surface); + color: var(--theme-text); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + font-family: var(--theme-font-primary); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); + } +} + +.w-100 { + width: 100%; +} + +.mac-btn-primary { + margin-left: 20px; + box-shadow: var(--theme-shadow); +} + +.mac-actions { + text-align: right; + margin-bottom: 24px; +} + +.mac-hint { + color: var(--theme-error, #ef4444); + font-size: 14px; + margin-top: 5px; +} + +.mac-grid { + background: var(--theme-surface); + border-radius: 16px; + overflow: hidden; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + + ::ng-deep .datagrid { + .datagrid-head { + background: var(--theme-background); + + .datagrid-column { + padding: 16px 24px; + font-size: 12px; + font-weight: 600; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid #e5e7eb; + } + } + + .datagrid-row { + transition: background-color 150ms ease-out; + + &:hover { + background: var(--theme-background); + } + + &:not(:last-child) { + border-bottom: 1px solid #e5e7eb; + } + + .datagrid-cell { + padding: 16px 24px; + font-size: 14px; + color: var(--theme-text); + } + } + + .datagrid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; + padding: 16px 24px; + } + } +} + +.mac-grid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; +} + +.mac-modal .modal-title { + color: var(--theme-text); +} + +// Hero and actions +.mac-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + font-family: var(--theme-font-primary); + + &__content { + display: flex; + align-items: center; + gap: 16px; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 16px; + display: flex; + align-items: center; + justify-content: center; + + clr-icon { + width: 36px; + height: 36px; + color: white; + } + } + + &__title { + font-size: 28px; + font-weight: 700; + margin: 0; + color: white; + font-family: var(--theme-font-secondary); + } + + &__subtitle { + font-size: 16px; + margin: 0; + opacity: 0.9; + color: rgba(255, 255, 255, 0.8); + } + + &__actions { + display: flex; + align-items: center; + gap: 16px; + } +} + +.mac-sep { + width: 1px; + height: 22px; + background: rgba(255, 255, 255, 0.5); +} + +.mac-label { + color: white; + font-weight: 500; +} + +.mac-toggle__label { + color: white; + font-weight: 500; +} + +// Grid columns +.mac-col-title { + display: inline-flex; + align-items: center; + gap: 6px; + color: var(--theme-text-secondary); +} + +.mac-col--perm .mac-col-title clr-icon { + color: var(--theme-primary); +} + +// Toolbar, search and stats +.mac-toolbar { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + padding: 16px; + background: var(--theme-surface); + border-radius: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &__left { + flex: 1; + } + + &__right { + display: flex; + gap: 16px; + } +} + +.mac-search { + position: relative; + max-width: 400px; + + clr-icon { + position: absolute; + left: 12px; + top: 50%; + transform: translateY(-50%); + color: #9ca3af; + z-index: 1; + } + + &__input { + width: 100%; + padding: 12px 12px 12px 40px; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + font-size: 14px; + transition: all 200ms ease-out; + background: var(--theme-surface); + color: var(--theme-text); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + font-family: var(--theme-font-primary); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); + } + } +} + +.mac-stats { + display: flex; + gap: 16px; +} + +.mac-stat { + min-width: 110px; + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.04); + border-radius: var(--theme-border-radius); + padding: 16px; + text-align: center; + box-shadow: var(--theme-shadow); + + &__value { + font-size: 24px; + font-weight: 700; + color: var(--theme-primary); + margin-bottom: 4px; + } + + &__label { + font-size: 12px; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + } +} + +// Enhanced modals +.mac-modal-title clr-icon { + margin-right: 6px; + color: var(--theme-primary); +} + +.mac-form-group { + margin-bottom: 20px; +} + +.mac-form-label { + display: block; + font-size: 14px; + font-weight: 500; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); +} + +.mac-form-select { + width: 100%; + padding: 12px 16px; + font-size: 14px; + line-height: 1.5; + color: var(--theme-text); + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + transition: all 200ms ease-out; + margin-bottom: 0; + font-family: var(--theme-font-primary); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e"); + background-position: right 12px center; + background-repeat: no-repeat; + background-size: 16px 12px; + padding-right: 40px; + appearance: none; + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); + } + + &:disabled { + background: var(--theme-background); + color: var(--theme-text-secondary); + cursor: not-allowed; + } +} + +.mac-form-help { + color: var(--theme-text-secondary); + font-size: 12px; + margin-top: 6px; + font-family: var(--theme-font-primary); +} + +.mac-perms { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 16px; + margin: 24px 0; +} + +.mac-perm { + display: flex; + align-items: center; + gap: 12px; + padding: 16px; + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.06); + border-radius: var(--theme-border-radius); + box-shadow: var(--theme-shadow); + transition: all 200ms ease-out; + + &:hover { + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + + input[type="checkbox"] { + width: auto; + padding: 0; + } +} + +.mac-perm__icon clr-icon { + color: var(--theme-primary); + width: 20px; + height: 20px; +} + +.mac-perm__label { + color: var(--theme-text); + font-weight: 500; + font-family: var(--theme-font-primary); +} + +// Datagrid action overflow buttons +.mac-action-item { + @extend .mac-btn; + @extend .mac-btn-ghost; + @extend .mac-btn-sm; + width: 100%; + justify-content: flex-start; + margin-bottom: 4px; + text-align: left; + + clr-icon { + width: 16px; + height: 16px; + margin-right: 8px; + } + + &.mac-btn-error { + color: var(--theme-error, #ef4444); + + &:hover { + background: rgba(239, 68, 68, 0.1); + } + } +} + +// Delete Modal Styles +.mac-delete-header { + text-align: center; + padding: 24px; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.mac-delete-icon { + color: var(--theme-error, #ef4444); + margin-bottom: 16px; +} + +.mac-delete-title { + font-size: 24px; + font-weight: 700; + color: var(--theme-text); + margin: 0 0 8px 0; +} + +.mac-delete-subtitle { + font-size: 16px; + color: var(--theme-text-secondary); + margin: 0; +} + +.mac-delete-details { + padding: 24px; +} + +.mac-delete-detail-item { + display: flex; + justify-content: space-between; + padding: 12px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + + &:last-child { + border-bottom: none; + } +} + +.mac-delete-detail-label { + font-weight: 500; + color: var(--theme-text-secondary); +} + +.mac-delete-detail-value { + font-weight: 600; + color: var(--theme-text); +} + +.delete, +.heading { + text-align: center; + color: var(--theme-error, #ef4444); +} + +// Modal Header +::ng-deep .modal-header { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px 16px 0 0 !important; + padding: 20px 24px !important; + + .modal-title { + color: white; + font-weight: 600; + font-size: 20px; + margin: 0; + } + + .close { + color: white; + opacity: 0.8; + + &:hover { + opacity: 1; + } + } +} + +// Modal Body +::ng-deep .modal-body { + padding: 24px !important; +} + +// Modal Footer +::ng-deep .modal-footer { + padding: 20px 24px !important; + background: var(--theme-background); + border-radius: 0 0 16px 16px !important; + border-top: 1px solid rgba(0, 0, 0, 0.05) !important; +} + +// Responsive adjustments +@media (max-width: 768px) { + .mac-hero { + flex-direction: column; + gap: 16px; + text-align: center; + + &__content { + flex-direction: column; + text-align: center; + } + + &__actions { + flex-direction: column; + width: 100%; + } + } + + .mac-toolbar { + flex-direction: column; + gap: 16px; + } + + .mac-search { + max-width: 100%; + } + + .mac-stats { + flex-direction: column; + width: 100%; + } + + .mac-perms { + grid-template-columns: 1fr; + } + + .mac-actions { + text-align: center; + } + + .mac-btn { + width: 100%; + justify-content: center; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.spec.ts new file mode 100644 index 0000000..46c2323 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MenuaccesscontrolComponent } from './menuaccesscontrol.component'; + +describe('MenuaccesscontrolComponent', () => { + let component: MenuaccesscontrolComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MenuaccesscontrolComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MenuaccesscontrolComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.ts new file mode 100644 index 0000000..ada1420 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.ts @@ -0,0 +1,299 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { MenuGroupService } from 'src/app/services/admin/menu-group.service'; +import { MenumaintanceService } from 'src/app/services/admin/menumaintance.service'; +import { UsergrpmaintainceService } from 'src/app/services/admin/usergrpmaintaince.service'; +import { UsermaintanceService } from '../../../../services/admin/usermaintance.service'; +import { ThemeService } from 'src/app/services/theme.service'; + +@Component({ + selector: 'app-menuaccesscontrol', + templateUrl: './menuaccesscontrol.component.html', + styleUrls: ['./menuaccesscontrol.component.scss'] +}) +export class MenuaccesscontrolComponent implements OnInit { + loading = false; + givendata; + alldata; + colvalue = "true"; + usergrpid = 1; + secmenuaccessdata; + modalAdd = false; + modaledit = false; + modaldelete = false; + modaldelete1 = false; + rowSelected: any = {}; + public entryForm: FormGroup; + selected = "true"; + menudata; + menus; + menuselectid = 1; + msg; + error; + mcreate; + medit; + mdelete; + toggle: boolean = false; + maindata; + showdata; + // UI enhancements (no API changes) + filterText: string = ''; + + constructor( + private mainservice: UsermaintanceService, + private _fb: FormBuilder, + private toastr: ToastrService, + private route: ActivatedRoute, + private usergrpservice: UsergrpmaintainceService, + private menuGroupService: MenuGroupService, + private menuservice: MenumaintanceService, + private themeService: ThemeService + ) { } + + ngOnInit(): void { + // Ensure theme variables are applied to the view + this.themeService.currentTheme$.subscribe(() => { + // CSS variables are updated globally; no extra handling needed here + }); + + this.showdata = this.menuGroupService.getdata(); + console.log(this.showdata); + this.mcreate = this.showdata.mcreate; + console.log(this.mcreate); + this.mdelete = this.showdata.mdelete + console.log(this.mdelete); + this.medit = this.showdata.medit + console.log(this.medit); + this.dropddowngetdata(); + // this.getall(); + this.getbyuseriddata(); + + this.entryForm = this._fb.group({ + grpid: this.usergrpid, + gmenuid: this.menuselectid, + }); + } + + // Stats & filtering helpers for UI only + get totalItems(): number { + const list: any[] = (this.alldata as unknown as any[]) || []; + return list.length; + } + + get mainMenuCount(): number { + const list: any[] = (this.alldata as unknown as any[]) || []; + return list.filter(it => it && it.menuId === 0).length; + } + + get subMenuCount(): number { + const list: any[] = (this.alldata as unknown as any[]) || []; + return list.filter(it => it && it.menuId !== 0).length; + } + + get filteredAllData(): any[] { + const items: any[] = (this.alldata as unknown as any[]) || []; + const text = (this.filterText || '').toLowerCase(); + if (!text) { return items; } + return items.filter(m => ( + (m?.menuItemDesc || '').toLowerCase().includes(text) + )); + } + + dropddowngetdata() { + this.usergrpservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + }); + } + + getdata() { + this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => { + this.menus = resp; + console.log('menus: ', this.menus); + }) + } + + getall() { + this.usergrpservice.getall().subscribe((data) => { + this.secmenuaccessdata = data + console.log(data); + }) + } + + idofselected(val) { + console.log(val); + this.usergrpid = val; + } + + idselected(val) { + console.log(val) + this.menuselectid = val; + } + + getbyuseriddata() { + this.usergrpservice.getbyusergrpid(this.usergrpid).subscribe((data) => { + this.alldata = data; + console.log(this.alldata); + if (this.alldata.array?.length === 0) { + this.msg = 'No Data Availabel' + } + for (this.alldata; this.alldata >= 100; this.alldata++) { + this.maindata = this.alldata.menuId === 0 + console.log(this.maindata) + } + + // console.log(this.menudata) + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.error = "No data Available" + } + }); + } + + modaladd() { + this.modalAdd = true; + this.getdata(); + } + + onSubmit() { + this.modalAdd = false; + this.entryForm.value.grpid = this.usergrpid; + this.entryForm.value.gmenuid = this.menuselectid; + console.log(this.entryForm.value); + this.menuservice.create2(this.entryForm.value).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Added successfully'); + } + this.ngOnInit(); + + }, + (error) => { + console.log('Error in adding data...', error); + if (error.status == 400) { + this.toastr.error(error.error); + + } else if (error) { + this.toastr.error('Not added Data Getting Some Error'); + } + this.ngOnInit(); + }); + } + + modalEdit(row) { + this.rowSelected = row; + console.log(this.rowSelected); + this.modaledit = true; + } + + modalDelete(row) { + this.rowSelected = row; + console.log(this.rowSelected) + this.modaldelete = true; + } + + delete(id, usrgrp) { + this.modaldelete = false; + this.usergrpservice.delete(id, usrgrp).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Deleted successfully'); + } + this.ngOnInit(); + }, (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + this.ngOnInit(); + }); + } + + modaldeletemainmenu(row) { + this.rowSelected = row; + console.log(this.rowSelected) + this.modaldelete1 = true; + } + + delete1(id, usrgrp) { + this.modaldelete1 = false; + this.usergrpservice.deletemain(id, usrgrp).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Deleted successfully'); + } + this.ngOnInit(); + }, (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + this.ngOnInit(); + }); + } + + onUpdate(id: any, usrgrp: any) { + this.modaledit = false; + console.log(id, usrgrp); + this.menuservice.update2(id, usrgrp, this.rowSelected).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Updated successfully'); + } + this.ngOnInit(); + }, (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Updated Data Getting Some Error'); + } + this.ngOnInit(); + }); + } + + onChecked(value) { + if (value == "y") { + this.selected = "y" + console.log(this.selected); // make a call for checked + } + else { + this.selected = "n"// make a call for unchecked + } + } + + changedelete(val) { + console.log(val); + val = this.colvalue = val; + console.log(val); + } + + data: {}; + Sync(id: any, row) { + this.rowSelected = row; + console.log(id); + if (this.rowSelected.subMenus != 0) { + this.rowSelected.subMenus = [] + } console.log(this.rowSelected); + this.menuservice.sink(id, this.rowSelected).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('SYNC successfully'); + } + this.ngOnInit(); + }, (error) => { + console.log(error); + if (error) { + this.toastr.error('Not SYNC Data Getting Some Error'); + } + this.ngOnInit(); + }) + } + + toggleCheckbox() { + this.toggle = !this.toggle; + //this.dataService.setDivToggler(this.toggler); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.html new file mode 100644 index 0000000..f9ee1bd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.html @@ -0,0 +1,569 @@ + + +
+
+
+
+ +
+
+

{{ 'MENU_MAINTENANCE' | translate }}

+

{{ 'MAIN_MENU' | translate }}

+
+
+
+ + + + +
+
+ +
+
+
{{ totalMenus }}
+
{{ 'TOTAL_MENUS' | translate }}
+
+
+
{{ enabledMenusCount }}
+
{{ 'ENABLED' | translate }}
+
+
+
{{ disabledMenusCount }}
+
{{ 'DISABLED' | translate }}
+
+
+ +
+
+ +
+
+ +
+ + +
+
+
+ + +
+
+
+
+
+
+ +
+
+
+
+
+ + {{'LOADING'|translate}} ... + +
+ +
{{ 'NO_DATA' | translate }}
+
{{ error }}
+
+
+ + + + + + + {{'NO' | translate}} + + + + + + {{'MENU_ITEM_NAME' | translate}} + + + + + + {{'ID' | translate}} + + + + + + {{'SEQUENCE' | translate}} + + + + + + {{'MODULE_NAME' | translate}} + + + + + + {{'MENU_ACTION_LINK' | translate}} + + + + + + {{'STATUS' | translate}} + + + + + + {{'SUB_MENU' | translate}} + + + + + + + {{'ACTION' | translate}} + + + + + + + + + {{i+1}} + +
+
+
+
{{user.menuItemDesc}}
+
ID: {{user.menuId}} • Seq: {{user.itemSeq}}
+
+
+
+ {{user.menuId}} + {{user.itemSeq}} + +
+ + {{user.moduleName}} +
+
+ + + + + {{user.status}} + + + +
+ + +
+ + + +
{{'WHO_COLUMN'|translate}}
+
{{'ACCOUNT_ID'|translate}} {{user.accountId}}
+
{{'CREATED_AT'|translate}} {{user.createdAt| date}}
+
{{'CREATED_BY'|translate}} {{user.createdBy}}
+
{{'UPDATED_AT'|translate}} {{user.updatedAt | date}}
+
{{'UPDATED_BY'|translate}} {{user.updatedBy}}
+
+
+
+ + + +
+
Menu Name{{user.menuItemDesc}}
+
Action Link{{user.main_menu_action_name}}
+
Module{{user.moduleName}}
+
+
+
+ + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ +
+
+
+
+ +
{{user.menuItemDesc}}
+
{{user.status}}
+
+
+
ID{{user.menuId}}
+
Sequence{{user.itemSeq}}
+
Module{{user.moduleName}}
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.scss new file mode 100644 index 0000000..d14e655 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.scss @@ -0,0 +1,650 @@ +input[type=text],[type=date],[type=password] { + width: 100%; + padding: 15px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + //background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +/* Modern theme-aware enhancements */ +.mm-container { + background: var(--theme-surface); + border-radius: var(--theme-border-radius); + box-shadow: var(--theme-shadow); + padding: 1rem; +} + +.mm-hero { + display: flex; + justify-content: space-between; + align-items: center; + background: var(--theme-glass-bg); + backdrop-filter: blur(12px); + border: 1px solid var(--theme-glass-border); + border-radius: calc(var(--theme-border-radius) + 4px); + padding: 1rem 1.25rem; + margin-bottom: 0.75rem; + box-shadow: var(--theme-glass-shadow); +} + +.mm-hero__content { + display: flex; + align-items: center; + gap: 0.75rem; +} + +.mm-hero__icon clr-icon { + width: 28px; + height: 28px; + color: var(--theme-primary); + filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15)); +} + +.mm-hero__title { + font-size: 1.25rem; + line-height: 1.2; + margin: 0; +} + +.mm-hero__subtitle { + margin: 0; + font-size: 0.875rem; + color: var(--theme-text-secondary); +} + +.mm-hero__actions .btn + .btn { + margin-left: 0.5rem; +} + +.mm-breadcrumb { + margin-bottom: 0.75rem; +} + +.mm-header-row { + align-items: center; + margin-top: 0.75rem; +} + +.mm-title-wrap { + display: inline-flex; + align-items: center; + gap: 0.75rem; +} + +.mm-title { + display: inline-block; + font-weight: 600; + color: var(--theme-text); +} + +.mm-subtitle { + display: inline-block; +} + +.mm-actions { + text-align: right; +} + +.mm-btn-group { + margin-right: 0.5rem; +} + +.mm-btn-primary { + border-radius: var(--theme-border-radius); + background: var(--theme-primary); + color: #fff; + box-shadow: 0 2px 6px rgba(0,0,0,0.08); + transition: transform 120ms var(--ease-out, cubic-bezier(0, 0, 0.2, 1)), box-shadow 150ms ease; +} + +.mm-btn-primary:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.12); transform: translateY(-1px); } +.mm-btn-primary:active { transform: translateY(0); } + +.mm-btn-outline { + border-radius: var(--theme-border-radius); + border: 1px solid var(--theme-primary); + color: var(--theme-primary); + background: transparent; +} + +.mm-btn-outline:hover { background: var(--theme-primary-100); } + +.mm-btn-secondary { + border-radius: var(--theme-border-radius); + background: var(--theme-secondary); + color: #fff; +} + +.mm-btn-text { + margin-left: 0.35rem; +} + +.mm-grid { + background: var(--theme-surface); + border-radius: var(--theme-border-radius); + box-shadow: var(--theme-shadow); +} +.mm-grid--modern .datagrid-header { + background: linear-gradient(135deg, var(--theme-primary-50), transparent); +} + +.mm-col-title { + display: inline-flex; + align-items: center; + gap: 6px; + font-weight: 600; +} + +.mm-col--icon { width: 44px; } +.mm-col--no { width: 70px; } +.mm-col--name { min-width: 220px; } +.mm-col--id { width: 120px; } +.mm-col--seq { width: 120px; } +.mm-col--module { min-width: 160px; } +.mm-col--link { min-width: 220px; } +.mm-col--status { width: 140px; } +.mm-col--submenu { width: 100px; } +.mm-col--action { width: 140px; } + +.mm-card { + background: var(--theme-glass-bg); + backdrop-filter: blur(10px); + border: 1px solid var(--theme-glass-border); + border-radius: var(--theme-border-radius); + padding: 0.25rem; +} + +.mm-grid-footer { + border-top: 1px solid rgba(0,0,0,0.06); +} + +.mm-col--icon, +.mm-cell--icon { + max-width: 40px; +} + +.mm-row:hover { + background: var(--theme-primary-50); +} + +.mm-icon-action { + cursor: pointer; + padding: 6px; + border-radius: 6px; + transition: background 150ms ease-out, transform 150ms ease-out; +} + +.mm-icon-action:hover { + background: var(--theme-primary-100); + transform: translateY(-1px); +} + +.mm-icon-edit { + color: var(--theme-accent); +} + +.mm-icon-link { + color: var(--theme-secondary); +} + +.mm-icon-help { + color: var(--theme-primary); +} + +.mm-icon-delete { + color: #ef4444; +} + +.mm-danger:hover { + background: rgba(239, 68, 68, 0.12); +} + +.mm-modal .modal-body { + background: var(--theme-surface); +} + +.mm-modal .modal-title { + font-weight: 600; +} + +/* Modernize Add/Edit modals */ +.mm-modal .modal-body form { + display: block; +} + +.mm-modal .modal-body .clr-row { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px 16px; +} + +@media (max-width: 640px) { + .mm-modal .modal-body .clr-row { grid-template-columns: 1fr; } +} + +.mm-modal label { + display: inline-block; + margin-bottom: 6px; + font-weight: 600; + color: var(--theme-text); +} + +.mm-modal input.clr-input, +.mm-modal select { + width: 100%; + padding: 10px 12px; + border-radius: 10px; + border: 1px solid rgba(0,0,0,0.12); + background: var(--theme-background); + transition: border-color 150ms ease, box-shadow 150ms ease; +} + +.mm-modal input.clr-input:focus, +.mm-modal select:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px var(--theme-primary-100); +} + +.mm-modal .modal-footer { + display: flex; + justify-content: flex-end; + gap: 10px; +} + +.mm-modal .modal-footer .btn.btn-primary { + background: var(--theme-primary); + color: #fff; + border-radius: 10px; +} + +.mm-modal .modal-footer .btn.btn-outline { + border-radius: 10px; + border: 1px solid var(--theme-secondary); + color: var(--theme-secondary); +} + +.mm-modal .error_mess { color: #ef4444; font-size: 12px; margin-top: 4px; } + +.mm-item { + display: flex; + align-items: center; + gap: 0.75rem; +} + +.mm-item__avatar clr-icon { + width: 18px; + height: 18px; + color: var(--theme-accent); +} + +.mm-item__title { + font-weight: 600; +} + +.mm-item__meta { + font-size: 0.75rem; + color: var(--theme-text-secondary); +} + +.mm-chip { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 2px 8px; + border-radius: 999px; + border: 1px solid rgba(0,0,0,0.06); + background: var(--theme-primary-50); +} + +.mm-link { + display: inline-flex; + align-items: center; + gap: 6px; +} + +.mm-badge { + display: inline-block; + padding: 2px 10px; + border-radius: 999px; + background: var(--theme-secondary); + color: white; + font-size: 0.75rem; +} + +.mm-badge--success { + background: var(--theme-primary); +} + +.mm-badge--muted { + background: var(--theme-primary-200); + color: var(--theme-text); +} + +.mm-actions-inline .btn { + margin-right: 6px; +} + +.mm-detail { + display: grid; + grid-template-columns: 1fr; + gap: 8px; + padding: 8px 0; +} + +.mm-detail__row { + display: flex; + justify-content: space-between; +} + +/* Skeleton loader */ +.mm-skeleton-list { + display: grid; + gap: 10px; + margin: 8px 0 12px; +} + +.mm-skeleton-item { + display: grid; + grid-template-columns: 44px 1.2fr 0.8fr 0.6fr 1fr 120px 140px; + align-items: center; + gap: 10px; + padding: 8px; + background: var(--theme-surface); + border-radius: var(--theme-border-radius); + border: 1px solid rgba(0,0,0,0.05); +} + +.mm-skel { + height: 12px; + border-radius: 6px; + background: linear-gradient( + 90deg, + rgba(0,0,0,0.05) 25%, + rgba(0,0,0,0.08) 37%, + rgba(0,0,0,0.05) 63% + ); + background-size: 400% 100%; + animation: mm-shimmer 1.2s ease-in-out infinite; +} + +.mm-skel--icon { width: 24px; height: 24px; border-radius: 50%; } +.mm-skel--title { width: 60%; height: 14px; } +.mm-skel--meta { width: 40%; } +.mm-skel--chip { width: 80px; } +.mm-skel--link { width: 60%; } +.mm-skel--badge { width: 70px; } +.mm-skel--actions { width: 60px; } + +@keyframes mm-shimmer { + 0% { background-position: 100% 0; } + 100% { background-position: 0 0; } +} + +@media (prefers-reduced-motion: reduce) { + .mm-skel { animation: none; } +} + +/* Row mount animation */ +.mm-row { transition: transform 220ms var(--ease-out, cubic-bezier(0, 0, 0.2, 1)), background 200ms ease; } +.mm-row.ng-enter { transform: translateY(8px); opacity: 0.001; } +.mm-row.ng-enter-active { transform: translateY(0); opacity: 1; } + +/* Responsive layouts */ +@media (max-width: 1024px) { + .mm-col--id, .mm-col--seq, .mm-col--submenu { display: none; } +} + +@media (max-width: 768px) { + .mm-col--link { display: none; } + .mm-item__meta { display: none; } + .mm-actions-inline .btn { padding: 0 6px; } +} + +@media (max-width: 640px) { + .mm-col--action { width: 100px; } + .mm-col--status { width: 110px; } + .mm-hero { flex-direction: column; align-items: flex-start; gap: 0.5rem; } + .mm-hero__actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; } +} + +/* Sticky toolbar */ +.mm-toolbar { + position: sticky; + top: 0; + z-index: 10; + display: flex; + justify-content: space-between; + align-items: center; + gap: 8px; + padding: 8px 10px; + margin-bottom: 8px; + background: var(--theme-surface); + border: 1px solid rgba(0,0,0,0.05); + border-radius: var(--theme-border-radius); + box-shadow: 0 1px 0 rgba(0,0,0,0.03); +} + +.mm-search { + display: inline-flex; + align-items: center; + gap: 6px; + border: 1px solid rgba(0,0,0,0.08); + padding: 6px 8px; + border-radius: 999px; + background: var(--theme-background); +} + +.mm-search__input { + border: none; + outline: none; + background: transparent; + min-width: 220px; +} + +.mm-select { + border-radius: 999px; + padding: 6px 10px; + border: 1px solid rgba(0,0,0,0.08); + background: var(--theme-background); +} + +@media (max-width: 640px) { + .mm-search__input { min-width: 140px; } +} + +.mm-view-toggle .btn { margin-left: 6px; border-radius: 999px; } + +/* Card view */ +.mm-cards { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 12px; +} + +@media (max-width: 1024px) { .mm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } } +@media (max-width: 640px) { .mm-cards { grid-template-columns: 1fr; } } + +.mm-card-item { + background: var(--theme-surface); + border: 1px solid rgba(0,0,0,0.06); + border-radius: var(--theme-border-radius); + box-shadow: var(--theme-shadow); + overflow: hidden; + display: flex; + flex-direction: column; +} + +.mm-card-item__header { + display: flex; + align-items: center; + gap: 10px; + padding: 10px 12px; + background: linear-gradient(135deg, var(--theme-primary-50), transparent); + min-height: 48px; +} + +.mm-card-item__icon clr-icon { color: var(--theme-primary); width: 18px; height: 18px; } +.mm-card-item__title { font-weight: 700; flex: 1 1 auto; } +.mm-card-item__badge { margin-left: auto; } + +/* Prevent overlaps and long text issues */ +.mm-ellipsis { + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.mm-card-item__title { + max-width: 60%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +@media (max-width: 640px) { + .mm-card-item__title { max-width: 54%; } +} + +.mm-card-item__body { + padding: 10px 12px; + display: grid; + grid-template-columns: repeat(2, minmax(0,1fr)); + gap: 8px; +} + +@media (max-width: 640px) { .mm-card-item__body { grid-template-columns: 1fr; } } + +.mm-kv { display: flex; justify-content: space-between; } +.mm-kv span { color: var(--theme-text-secondary); } + +.mm-card-item__footer { + padding: 10px 12px; + display: flex; + gap: 8px; + border-top: 1px solid rgba(0,0,0,0.06); +} + +/* Theme the card footer buttons */ +.mm-card-item__footer .btn { + border-radius: 10px; +} + +.mm-card-item__footer .btn.btn-outline { + border: 1px solid var(--theme-secondary); + color: var(--theme-secondary); + background: transparent; +} + +.mm-card-item__footer .btn.btn-outline:hover { background: rgba(0,0,0,0.04); } + +.mm-card-item__footer .btn:not(.btn-outline) { + background: var(--theme-primary); + color: #fff; +} + +.mm-card-item__footer .btn:not(.btn-outline):hover { + filter: brightness(0.98); +} + +/* View toggle buttons */ +.mm-view-toggle .btn.btn-primary { background: var(--theme-primary); color: #fff; } +.mm-view-toggle .btn:not(.btn-primary) { background: var(--theme-primary-100); color: var(--theme-text); } + +.mm-stats { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.75rem; + margin: 0.75rem 0 1rem; +} + +.mm-stat { + background: var(--theme-surface); + border-radius: var(--theme-border-radius); + padding: 0.75rem 1rem; + border: 1px solid rgba(0,0,0,0.05); +} + +.mm-stat__value { + font-size: 1.25rem; + font-weight: 700; + color: var(--theme-primary); +} + +.mm-stat__label { + font-size: 0.75rem; + color: var(--theme-text-secondary); +} + +.mm-empty { + text-align: center; + padding: 1.5rem 0.5rem; + color: var(--theme-text-secondary); +} + +.mm-empty clr-icon { + width: 32px; + height: 32px; + color: var(--theme-secondary); + margin-bottom: 0.25rem; +} + +.mm-empty__title { + font-weight: 600; +} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.spec.ts new file mode 100644 index 0000000..4024471 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MenumaintanceComponent } from './menumaintance.component'; + +describe('MenumaintanceComponent', () => { + let component: MenumaintanceComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MenumaintanceComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MenumaintanceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.ts new file mode 100644 index 0000000..03d5887 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menumaintance/menumaintance.component.ts @@ -0,0 +1,291 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ToastrService } from 'ngx-toastr'; +import { MenumaintanceService } from '../../../../services/admin/menumaintance.service'; +import { Rn_Main_Menu } from '../../../../models/builder/Rn_Main_Menu'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MenuGroupService } from 'src/app/services/admin/menu-group.service'; +import { CsvService } from 'src/app/services/csv.service'; +import { ExcelService } from 'src/app/services/excel.service'; +import * as moment from 'moment'; +import { TranslateService } from '@ngx-translate/core'; +import { ThemeService } from 'src/app/services/theme.service'; +@Component({ + selector: 'app-menumaintance', + templateUrl: './menumaintance.component.html', + styleUrls: ['./menumaintance.component.scss'] +}) +export class MenumaintanceComponent implements OnInit { + loading = false; + selected: any[] = []; + rowSelected: any = {}; + modaldelete = false; + modalAdd = false; + modaledit = false; + givendata; + menus: Rn_Main_Menu[]; + mainid = 0; + public entryForm: FormGroup; + mcreate; + mdelete; + medit; + showdata; + error; + submitted = false; + // Quick filter UI state (no API/logic changes) + filterText = ''; + statusFilter: 'All' | 'Enable' | 'Disable' | '' = 'All'; + viewMode: 'cards' | 'table' = 'cards'; + constructor(private menuservice: MenumaintanceService, + private toastr: ToastrService, + private excel: ExcelService, + private _fb: FormBuilder, + private route: ActivatedRoute, + private menuGroupService: MenuGroupService, + private csvService: CsvService, + private translate: TranslateService, + private router: Router, + private themeService: ThemeService) { } + + ngOnInit(): void { + // Ensure theme variables are applied; subscription keeps this view reactive to theme changes + this.themeService.currentTheme$.subscribe(() => { + // Theme applied globally via CSS variables; no additional handling needed here + }); + this.showdata = this.menuGroupService.getdata(); + console.log(this.showdata); + this.mcreate = this.showdata.mcreate; + console.log(this.mcreate); + this.mdelete = this.showdata.mdelete + console.log(this.mdelete); + this.medit = this.showdata.medit + console.log(this.medit); + + // this.menuservice.getAll().subscribe((data) => { + // console.log(data); + // this.givendata = data; + // }); + + this.entryForm = this._fb.group({ + // menuItemId:[null], + menuId: [null], + menuItemDesc: ['', [Validators.required]], + itemSeq: ['', [Validators.required, Validators.pattern(/^-?(0|[1-9]\d*)?$/)]], + moduleName: ['', [Validators.required]], + status: ['', [Validators.required]], + main_menu_action_name: ['', [Validators.required]], + main_menu_icon_name: ['', [Validators.required]] + }); + this.getdata(); + } + + // Stats for UI (template-safe, no inline arrow functions) + get totalMenus(): number { + return this.menus ? this.menus.length : 0; + } + + get enabledMenusCount(): number { + const list: any[] = (this.menus as unknown as any[]) || []; + return list.filter(menu => menu && menu.status === 'Enable').length; + } + + get disabledMenusCount(): number { + const list: any[] = (this.menus as unknown as any[]) || []; + return list.filter(menu => menu && menu.status === 'Disable').length; + } + + // Filtered list for view + get filteredMenus(): Rn_Main_Menu[] { + const items: any[] = (this.menus as unknown as any[]) || []; + const text = (this.filterText || '').toLowerCase(); + const status = this.statusFilter; + return items.filter(m => { + const matchText = !text || ( + (m.menuItemDesc || '').toLowerCase().includes(text) || + (m.moduleName || '').toLowerCase().includes(text) || + (m.main_menu_action_name || '').toLowerCase().includes(text) + ); + const matchStatus = !status || status === 'All' || m.status === status; + return matchText && matchStatus; + }); + } + + setViewMode(mode: 'cards' | 'table') { + this.viewMode = mode; + } + + // Resolve a safe Clarity icon shape for a menu item + getIconShape(menu: any): string { + const raw = (menu?.main_menu_icon_name ?? menu?.mainMenuIconName ?? '').toString().trim(); + const name = raw.toLowerCase(); + const invalid = !name || name === 'undefined' || name === 'null' || name === '-' || name === 'na' || name === 'n/a'; + if (invalid) { + return 'file'; // universal fallback icon + } + // Optional alias normalization + const aliasMap: Record = { + 'home': 'home', + 'dashboard': 'dashboard', + 'menu': 'list', + 'list': 'list', + 'link': 'link', + 'application': 'application', + 'applications': 'applications', + 'module': 'application', + 'settings': 'cog', + 'config': 'cog', + 'user': 'user', + 'users': 'users', + 'folder': 'folder', + 'file': 'file', + 'tag': 'tag', + 'bookmark': 'bookmark' + }; + return aliasMap[name] ?? name; + } + + switchLanguage(language: string) { + this.translate.use(language); + } + getdata() { + this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => { + this.menus = resp; + console.log('menus: ', this.menus); + if (this.menus.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) + } + onSubmit() { + this.submitted = true; + if (this.entryForm.invalid) { + return; + } + this.menuservice.create1(this.entryForm.value).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Added successfully'); + } + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not added Data Getting Some Error'); + } + this.getdata(); + }); + this.modalAdd = false; + } + goToAdd() { + this.modalAdd = true; + } + submenu(id: any) { + this.router.navigate(["../submenu/" + id], { relativeTo: this.route }) + } + data: {}; + shrink(id: any, row) { + this.rowSelected = row; + console.log(this.rowSelected); + if (this.rowSelected.subMenus != 0) { + this.rowSelected.subMenus = [] + } console.log(this.rowSelected); + this.menuservice.sink(id, this.rowSelected).subscribe((data) => { + console.log(data); + }) + } + goToEdit(row) { + this.rowSelected = row; + console.log(row) + this.modaledit = true; + //this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.menuservice.delete1(id).subscribe((data) => { + console.log(data); + this.toastr.success('Deleted successfully'); + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', +error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + }); + + } + onUpdate(id) { + this.modaledit = false; + this.menuservice.update1(id, this.rowSelected).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Updated successfully'); + } + this.ngOnInit(); + + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not updated Data Getting Some Error'); + } + this.ngOnInit(); + + }); + } + + onExport() { + this.excel.exportAsExcelFile(this.givendata, 'menumaintanance_', + moment().format('YYYYMMDD_HHmmss')) + } + + // csv + + modalCsv = false; + selectedFiles: File; + fileList; + ttype = 'menumaintenance'; + + + // Import CSV + public selectFile(event) { + this.selectedFiles = event.target.files[0]; + // this.saveCsv(); + } + + csvImport() { + console.log("import CSV"); + this.modalCsv = true; + } + saveCsv() { + this.csvService.importCsv(this.selectedFiles, this.ttype).subscribe(data => { + console.log(data); + this.fileList = data; + this.modalCsv = false; + }, + (error) => { + console.log(error); + if (error.status == 202) { + this.toastr.success(error.error.text) + } + }); + } + + downloadFiles() { + this.csvService.downloadCsvs(this.ttype); + + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.html new file mode 100644 index 0000000..c74922e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.html @@ -0,0 +1,146 @@ + + + + + +
+
+

Modules

+
+
+ + +
+
+ + + + Loading ... +
{{error}}
+ + + Modules + + + Description + + + Access Exclusive + + + + + + {{user.modules}} + {{user.description}} + {{user.access_exclusive}} + + + + + + + + + + + + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.scss new file mode 100644 index 0000000..ab11a3c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.scss @@ -0,0 +1,62 @@ +input[type=text],[type=date],[type=password] { + width: 100%; + padding: 15px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + //background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.spec.ts new file mode 100644 index 0000000..cf10dbf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ModulesComponent } from './modules.component'; + +describe('ModulesComponent', () => { + let component: ModulesComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ModulesComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ModulesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.ts new file mode 100644 index 0000000..b681676 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/modules/modules.component.ts @@ -0,0 +1,121 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ToastrService } from 'ngx-toastr'; +import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; + +@Component({ + selector: 'app-modules', + templateUrl: './modules.component.html', + styleUrls: ['./modules.component.scss'] +}) +export class ModulesComponent implements OnInit { + loading = false; + selected: any[] = []; + rowSelected: any = {}; + modaldelete = false; + modalAdd = false; + modaledit = false; + error; + data; + submitted = false; + public entryForm: FormGroup; + constructor(private _fb: FormBuilder, private accesstype: AccesstypeService, + private toastr: ToastrService,) { } + + ngOnInit(): void { + this.entryForm = this._fb.group({ + modules: ['', [Validators.required]], + description: ['', [Validators.required]], + access_exclusive: ['', [Validators.required]], + }); + this.getdata(); + } + getdata() { + this.accesstype.getAll1().subscribe(resp => { + this.data = resp; + console.log('menus: ', this.data); + if (this.data.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) + } + goToAdd() { + this.modalAdd = true; + } + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } + this.accesstype.create1(this.entryForm.value).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Added successfully'); + } + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not added Data Getting Some Error'); + } + this.ngOnInit(); + + }); + this.modalAdd = false; + } + goToEdit(row) { + this.rowSelected = row; + console.log(row) + this.modaledit = true; + //this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.accesstype.delete1(id).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Deleted successfully'); + } + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + this.ngOnInit(); + }); + + } + onUpdate(id) { + this.modaledit = false; + this.accesstype.update1(id, this.rowSelected).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Updated successfully'); + } + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not updated Data Getting Some Error'); + } + this.ngOnInit(); + }); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.css b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.css new file mode 100644 index 0000000..8f4c16f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.css @@ -0,0 +1,85 @@ +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; +} +.s-info-bar button { + outline: none; +} + +.delete, .heading { + text-align: center; + color: red; +} + +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} + +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} + +select { + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +input[type=text], [type=date], [type=number], textarea { + width: 100%; + padding: 15px 15px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.error_mess { + color: red; +} + +.required-field { + color: red; + font-size: 18px; +}/*# sourceMappingURL=myworkspace.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.css.map new file mode 100644 index 0000000..768da17 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["myworkspace.component.scss","myworkspace.component.css"],"names":[],"mappings":"AAWA;EACE,aAAA;EACA,mBAAA;EACA,8BAAA;ACVF;ADWE;EACE,aAAA;ACTJ;;ADYA;EACE,kBAAA;EACA,UAAA;ACTF;;ADWA;EACE,YAAA;ACRF;;ADWA;EACE,aAAA;ACRF;;ADUA;EACE,mBAAA;ACPF;;ADUA;EACE,yBAAA;EACA,YAAA;ACPF;;ADUA;EAEE,aAAA;EACA,eAAA;ACRF;;ADWA;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACRF;;ADWA;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EAEA,eAAA;EACA,WAAA;EACA,mBAAA;ACTF;;ADYA;EACE,kBAAA;ACTF;;ADWA;EACE,WAAA;EACA,eAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACRF;;ADUA;EACE,WAAA;EACA,kBAAA;EACA,oCAAA;EAEA,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACRF;;ADUA;EACE,UAAA;ACPF;;ADUA;EACE,UAAA;EACF,eAAA;ACPA","file":"myworkspace.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.html new file mode 100644 index 0000000..c39b264 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.html @@ -0,0 +1,309 @@ +
+

Organization and Workspaces

+
+ +
+ + + + + + + + + + + + + + + switch + +
Organization: {{ sys_account.companyName }}
Account Id: {{ sys_account.gstNumber }}
Selected Workspace: {{sys_account.workspace }}
+ +
+ + + + + + + + Loading ... + + + No + + + Name + + + Account Type + + + Status + + + Actions + + + {{i+1}} + + {{user.fullName}}
{{user.username}}{{user.email}}
+ + + {{user.status}} + +
+ + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+
+ + + + + + Loading ... + + + No + + + Name + + + Account Type + + + Status + + + Access Till + + + Actions + + + {{i+1}} + + {{user.fullName}}
{{user.username}}{{user.email}}
+ {{user.roles[0].description}} + {{user.status}} + {{user.access_duration}} + + +
+ + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+
+ + + + + + Loading ... + + + No + + + Team Name + + + Owner + + + Count + + + Members + + + + {{i+1}} + {{user.name}} + {{user.owner_id}} + 3 +
+ +
+
+ +
+ + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+
+ +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.scss new file mode 100644 index 0000000..9568abf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.scss @@ -0,0 +1,94 @@ +// input[type=text],[type=date], select,textarea { +// width: 100%; +// padding: 12px 20px; +// margin: 8px 0; +// display: inline-block; +// border: 1px solid #ccc; +// border-radius: 4px; +// box-sizing: border-box; +// } + +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} + +.required-field{ + color: red; +font-size: 18px; + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.spec.ts new file mode 100644 index 0000000..46b827c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MyworkspaceComponent } from './myworkspace.component'; + +describe('MyworkspaceComponent', () => { + let component: MyworkspaceComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MyworkspaceComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MyworkspaceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.ts new file mode 100644 index 0000000..283c78d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.component.ts @@ -0,0 +1,206 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { UserProfileService } from 'src/app/services/admin/user-profile.service'; +import { UserInfoService } from 'src/app/services/user-info.service'; +import { Sys_Account } from 'src/app/services/admin/user-registration.service'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ToastrService } from 'ngx-toastr'; +import { MyworkspaceService } from './myworkspace.service'; +@Component({ + selector: 'app-myworkspace', + templateUrl: './myworkspace.component.html', + styleUrls: ['./myworkspace.component.scss'] +}) +export class MyworkspaceComponent implements OnInit { + loading = false; + selected: any[] = []; + sys_account: Sys_Account; + + userEmail: string; + companyName: string; + workspace: string; + gstNumber: string; + modalteam = false; + modaluser = false; + modalguest = false; + allworkmodal = false; + allworkspacedata; + alluser; + allguest; + allwdata; + public teamForm: FormGroup; + public userForm: FormGroup; + public guestForm: FormGroup; + public entryForm: FormGroup; + constructor(private router: Router, + private route: ActivatedRoute, + private userProfileService: UserProfileService, + private userInfoService: UserInfoService, + private _fb: FormBuilder, + private toastr: ToastrService, + private mywork: MyworkspaceService) { } + + ngOnInit(): void { + //addteam + this.teamForm = this._fb.group({ + name: [null, [Validators.required]], + }); + //add user + this.userForm = this._fb.group({ + email: [null, [Validators.required, Validators.pattern("[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$")]], + }); + //add guest + this.guestForm = this._fb.group({ + email: [null, [Validators.required, Validators.pattern("[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$")]], + access_duration: [null, [Validators.required]], + }) + this.getUserAccount(); + this.getUserRoles(); + this.getallmyworkspace(); + this.getalluser(); + this.getallguest(); + } + getUserAccount() { + this.userProfileService.getUserAccountDetails().subscribe(resp => { + this.sys_account = resp; + console.log("array", this.sys_account); + }, err => { console.log(err); } + ) + } + + + addUsers() { + this.modaluser = true; + //this.router.navigate(["../users"], { relativeTo: this.route }); + } + manage(id: any) { + this.router.navigate(["../manageteam/" + id], { relativeTo: this.route }); + } + goToResetPassword() { + this.router.navigate(["../passwordreset"], { relativeTo: this.route }); + } + + roles: string[] + role: string; + getUserRoles() { + const role = this.userInfoService.getRoles(); + console.log('roles = ', role); + + // if(role !== null) { + // this.roles = role.split(','); + // } + this.role = role; + console.log(this.role); + } + + isAdmin(): boolean { + const role: string = this.userInfoService.getRoles(); + if (role.includes('ADMIN')) { + return true; + } + return false; + } + addteam() { + this.modalteam = true; + } + addguest() { + this.modalguest = true; + } + getalluser() { + this.mywork.getalluser().subscribe((data) => { + this.alluser = data; + console.log(this.alluser); + }) + } + getallguest() { + this.mywork.getallguest().subscribe((data) => { + this.allguest = data; + console.log(this.allguest); + }) + } + getallmyworkspace() { + this.mywork.getall().subscribe((data) => { + this.allworkspacedata = data; + console.log(this.allworkspacedata); + }) + } + + onCreateuser() { + let email = this.userForm.value.email; + console.log(email); + this.mywork.adduser(this.userForm.value.email).subscribe((data) => { + this.mywork.storeEmail(email); + console.log(data); + if (data) { + this.toastr.success('Email Send successfully'); + } + this.getalluser(); + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + this.toastr.success(error.error.text); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error(error.error.message); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + } + }); + this.modaluser = false; + } + + onCreateguest() { + this.mywork.addguest(this.guestForm.value.email, this.guestForm.value.access_duration).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Email Send successfully'); + } + this.getallguest(); + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + this.toastr.success(error.error.text); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error(error.error.message); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + } + }) + this.modalguest = false; + } + oncreateteam() { + this.modalteam = false; + this.mywork.addteam(this.teamForm.value).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Team Added successfully'); + } + this.getallmyworkspace(); + }, (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not added Getting Some Error'); + } + }) + } + allworksapce() { + this.allworkmodal = true; + this.mywork.getallworkspace().subscribe((data) => { + this.allwdata = data; + console.log(data); + }) + } + + copyInputMessage(inputElement) { + inputElement.select(); + document.execCommand('copy'); + inputElement.setSelectionRange(0, 0); + + if (inputElement.setSelectionRange) { + this.toastr.success("Link Copy Succesfully"); + } + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.service.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.service.ts new file mode 100644 index 0000000..ae0913b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/myworkspace/myworkspace.service.ts @@ -0,0 +1,115 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; + +import { Observable } from 'rxjs'; +import { ApiRequestService } from 'src/app/services/api/api-request.service'; +import baseUrl from 'src/app/services/api/helper'; + +@Injectable({ + providedIn: 'root' +}) +export class MyworkspaceService { + public localStorage: Storage = localStorage; + constructor(private _http: HttpClient,private apiRequest: ApiRequestService) { } + public add(r: any){ + return this._http.post(`${baseUrl}/api/menu-register`, r); + } + + public getall(){ + return this._http.get(`${baseUrl}/Workspace_team/SecTeam/AccountId`); + } + public getalluser(){ + return this._http.get(`${baseUrl}/User_workSpace/GetAllUser`); + } + public getallguest(){ + return this._http.get(`${baseUrl}/User_workSpace/GetAllGuest`); + } + public adduser(email:any){ + let params: HttpParams = new HttpParams(); + params = params.append("email", email); + return this._http.post(`${baseUrl}/api/userviaadmin`,params); + } + storeEmail(email: string) { + this.localStorage.setItem("registeredEmail", email); + } + //Store userinfo from session storage + + //Get email from session storage ( WILL REMOVE AFTER REGISTER) + getStoredEmail(): string | null { + try { + let email: string = this.localStorage.getItem( + "registeredEmail" + ); + if (email) { + return email; + } else { + return null; + } + } catch (e) { + return null; + } + } + adduserdetails(data:any,token:any):Observable{ + return this._http.post(`${baseUrl}/api/admin/adduser/${token}`,data); + } + + addguest(email:any,duration:any){ + let params: HttpParams = new HttpParams(); + params = params.append("email", email); + params=params.append("access_duration",duration) + return this._http.post(`${baseUrl}/api/guest_via_admin`,params); + } + + addguestdetails(data:any,token:any):Observable{ + return this._http.post(`${baseUrl}/api/admin/addguest/${token}`,data); + } + addteam(data:any){ + return this._http.post(`${baseUrl}/Workspace_team/SecTeam`,data); + } + public getallteammeme(id:any){ + return this._http.get(`${baseUrl}/User_workSpace/GetAllMember/${id}`); + } + getallusertosameaccid(){ + return this._http.get(`${baseUrl}/User_workSpace/GetAll/AccountId`); + } + addteammem(id:any,user_id:any,data:any){ + return this._http.post(`${baseUrl}/User_workSpace/add_team/${id}/${user_id}`,data); + } + getallworkspace(){ + return this._http.get(`${baseUrl}/Workspace_workspace/FindByaccount`); + } + addsecworkspaceuser(usrid:any,id:any,data:any,){ + return this._http.post(`${baseUrl}/workspace/secworkspaceuser/add_workspace/users/${usrid}/${id}`,data); + } + addsecworkteam(pid:any,tid:any,data:any){ + return this._http.post(`${baseUrl}/workspace/secworkspaceuser/addteam/${pid}/${tid}`,data); + } + getallsecworkspace(id:any):Observable{ + return this._http.get(`${baseUrl}/workspace/secworkspaceuser/get_by_projectid/${id}`); + } + // public getById(id: any){ + // return this._http.get(`${baseUrl}/api/menu-register/${id}`); + // } + + // public update(id:any, reg:any){ + // return this._http.put(`${baseUrl}/api/menu-register/${id}`, reg); + // } + + // public deleteById(id: any){ + // return this._http.delete(`${baseUrl}/api/menu-register/${id}`); + // } + + + +////////////////////project users + +addprojectuser(userId: any, projectId: any, duration: any, role: string):Observable { + const params = new HttpParams().set('role', role); + return this._http.post(`${baseUrl}/workspace/secworkspaceuser/add_workspace/users/${userId}/${projectId}/${duration}`, {}, { params }); +} + +///for team +public addprojectteam(projectId:any,teamId:any){ + return this._http.post(`${baseUrl}/workspace/secworkspaceuser/addteam/${projectId}/${teamId}`, {}); +} +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.html new file mode 100644 index 0000000..472d4bb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.html @@ -0,0 +1,43 @@ +
+
+

Please Reset Your Password

+

you're signed in as {{ email }}

+
+ +
+
+ + +
+
Password is required
+
+
+
+ + +
+
password is required
+
Password must be Minimum 3 Characters
+
+
+
+ + +
+
Password is required.
+
Password and Confirm Password must be match.
+
+
+ +
+
+
+

Wrong account? Log in instead.

+
+
diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.scss new file mode 100644 index 0000000..3ee7d64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.scss @@ -0,0 +1,83 @@ +//@import '../../../../../styles1.scss'; + + +//** variables +$background: #f5f6fa; +$text: #9c9c9c; +$input-bg-color: #fff; +$input-text-color: #a3a3a3; +$button-bg-color: #7f8ff4; +$button-text-color: #fff; +$google-button-bg-color: #7f8ff4; +$linkedin-button-bg-color: #4b76eb; + +//** root +:root { + background: $background; + color: $text; + font: 1rem "PT Sans", sans-serif; +} + +//** helper +.display_msg { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.form { + /* margin-left: auto; + margin-right: auto; */ + &__field { + // width: 360px; + // //background: #fff; + // color: $input-text-color; + // font: inherit; + // //box-shadow: 0 6px 10px 0 rgba(0, 0, 0 , .1); + // border: 1 solid rgb(235, 230, 230); + // background-color:rgb(255, 255, 255); + // display: inline-block; + // border-radius: 4px; + // box-sizing: border-box; + // //outline: 0; + // padding: 6px 9px; + width: 360px; + padding: 9px 11px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } +} + +.btn { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; + + &--primary { + background: $button-bg-color; + color: $button-text-color; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + width: 100%; + + &:hover { + background: darken($button-bg-color, 4%); + } + + &:active { + background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.spec.ts new file mode 100644 index 0000000..e6bd9ac --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PasswordResetComponent } from './password-reset.component'; + +describe('PasswordResetComponent', () => { + let component: PasswordResetComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PasswordResetComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PasswordResetComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.ts new file mode 100644 index 0000000..d17961f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/password-reset/password-reset.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { UserRegistrationService } from 'src/app/services/admin/user-registration.service'; +import { UserInfoService } from 'src/app/services/user-info.service'; + +export interface ResetPasswordRequest { + oldPassword: string; + newPassword: string; +} +@Component({ + selector: 'app-password-reset', + templateUrl: './password-reset.component.html', + styleUrls: ['./password-reset.component.scss'] +}) +export class PasswordResetComponent implements OnInit { + + emailErrMsg: string = "" + oldpHide: boolean = true; + oldIcon: string = "eye"; + oldShapeChanger() { + this.oldpHide = !this.oldpHide; + if(this.oldpHide){ + this.oldIcon = 'eye' + } else { + this.oldIcon = 'eye-hide' + } + } + newpHide: boolean = true; + newIcon: string = "eye"; + newShapeChanger() { + this.newpHide = !this.newpHide; + if(this.newpHide){ + this.newIcon = 'eye' + } else { + this.newIcon = 'eye-hide' + } + } + cpHide: boolean = true; + conIcon: string = "eye"; + comfShapeChanger() { + this.cpHide = !this.cpHide; + if(this.cpHide){ + this.conIcon = 'eye' + } else { + this.conIcon = 'eye-hide' + } + } + + constructor( private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private userRegistrationService: UserRegistrationService, + private userInfoService: UserInfoService) { } + + email: string; + resetPasswordForm: FormGroup; +userid; + ngOnInit(): void { + this.email = this.userInfoService.getEmail(); + this.userid=this.userInfoService.getUserId(); + console.log(this.userid); + + this.resetPasswordForm = this._fb.group({ + userId:this.userid, + oldPassword: ['', Validators.required], + newPassword: ['', [Validators.required, Validators.minLength(3)]], + confirmPassword: ['', [Validators.required]] + }, { + validator: ConfirmedValidator('newPassword', 'confirmPassword') + }); + } + get f() { return this.resetPasswordForm.controls; } + + submitted = false; + onSubmit() { + console.log('this.resetPasswordForm.value : ', this.resetPasswordForm.value); + this.submitted = true; + if(this.resetPasswordForm.invalid){ + return; + } + this.resetPassword(); + } + + resetPassword() { + this.userRegistrationService.resetPassword(this.resetPasswordForm.value) + .subscribe((res) => { + console.log('success ', res); + this.router.navigate(["../user-account"], { relativeTo: this.route }); + },(err) => { + console.log('failure ', err); + }); + } +} + +export function ConfirmedValidator(controlName: string, matchingControlName: string){ + return (formGroup: FormGroup) => { + const control = formGroup.controls[controlName]; + const matchingControl = formGroup.controls[matchingControlName]; + if (matchingControl.errors && !matchingControl.errors.confirmedValidator) { + return; + } + if (control.value !== matchingControl.value) { + matchingControl.setErrors({ confirmedValidator: true }); + } else { + matchingControl.setErrors(null); + } + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.html new file mode 100644 index 0000000..37105ea --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.html @@ -0,0 +1,266 @@ + +
+ + + + + + +
+

My Profile Settings

+ +
+ Avatar +
+ + Avatar + +
{{ message }}
+ + + + + + + +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+ + + + +
+
+ +
+ +
+
+ +
+ +
+ + +
+ + + +
Password: Change Password for your account Change password
+
+
+ + +
+ + +
+ + +
Security: Logout of all sessions except this current browser Logout other + sessions
+
+
+ + +
+ + +
+ + +
Deactivation: Remove access to all organizations and workspace in cloudnsure Deactivate account
+
+ +
+ + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.scss new file mode 100644 index 0000000..ec6f039 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.scss @@ -0,0 +1,10 @@ +input[type=text],[type=date],textarea,[type=number] { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.spec.ts new file mode 100644 index 0000000..c4570be --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProfileSettingComponent } from './profile-setting.component'; + +describe('ProfileSettingComponent', () => { + let component: ProfileSettingComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ProfileSettingComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ProfileSettingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.ts new file mode 100644 index 0000000..5483ddb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/profile-setting/profile-setting.component.ts @@ -0,0 +1,223 @@ + +import { HttpClient, HttpEventType } from '@angular/common/http'; +import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { UserProfile, UserProfileService } from '../../../../services/admin/user-profile.service'; +import { DomSanitizer } from '@angular/platform-browser'; +import { AlertService } from '../../../../services/alert.service'; +import { ToastrService } from 'ngx-toastr'; +import { Dimensions, ImageCroppedEvent, ImageTransform } from 'ngx-image-cropper'; +//import { ImageCroppedEvent } from '../image-cropper/interfaces/image-cropped-event.interface'; +//import { ImageCropperComponent } from '../image-cropper/component/image-cropper/image-cropper.component'; +@Component({ + selector: 'app-profile-setting', + templateUrl: './profile-setting.component.html', + styleUrls: ['./profile-setting.component.scss'] +}) +export class ProfileSettingComponent implements OnInit { + updated = false; + userProfile: UserProfile; + roles = ['user', 'admin', 'mis report', 'bi report']; + transform: ImageTransform = {}; + model=false; + constructor( + private router: Router, + private route: ActivatedRoute, + private userProfileService: UserProfileService, + private http: HttpClient, + private alertService: AlertService, + private _sanitizer: DomSanitizer, + private toastr: ToastrService, + ) { } + + ngOnInit(): void { + + this.getUserProfile(); + this.getProfilePic(); + } + getUserProfile() { + this.userProfileService.getUserProfile().subscribe(res => { + console.log(res); + this.userProfile = res; + }) + } + + update() { + this.userProfileService.updateUserProfile(this.userProfile).subscribe( + (resp) => { + console.log(resp); + //this.router.navigate(["../../all"], { relativeTo: this.route }); + }, + (error) => { + console.log(error); + } + ); + //this.picUpload(); + } + + public profilePic: File = null; + onSelectFile(event) { + let flag = 0; + const mimeType = event.target.files[0].type; + if(mimeType.match(/image\/*/) === null ){ + this.message = 'Only Image Type Is Supported'; + flag = flag + 1; + return; + } + const size = event.target.files[0].size; + if(size > 5000000) { + flag = flag + 1; + this.message = 'Plese Select image file under 2 MB'; + return; + } + console.log('flag value = ', flag); + if(flag === 0) { + this.profilePic = event.target.files[0]; + console.log(this.profilePic); + const reader = new FileReader(); + this.image = this.profilePic; + reader.readAsDataURL(this.profilePic); + reader.onload = (_event) => { + this.image = reader.result; + } + this.picUpload(); + } + + } + + message: string; + picUpload() { + this.userProfileService.uploadUserProfilePic(this.profilePic).subscribe(res => { + console.log(res); + if(res.type === HttpEventType.UploadProgress){ + console.log('Upload Progress : ', + Math.round(res.loaded / res.total * 100) + '%'); + } else if(res.type === HttpEventType.Response) { + if (res.status === 200) { + this.alertService.success('Image uploaded successfully'); + //this.message = 'Image uploaded successfully'; + } else { + this.message = 'Image not uploaded'; + } + } + }, err => {console.log(err); + }); + } + image: any; + getProfilePic() { + this.userProfileService.getProfilePic().subscribe(res => { + console.log(res); + this.image = this._sanitizer.bypassSecurityTrustResourceUrl(res.image); + }, err => {console.log(err);} + ); + } + + /*picUpload() { + const uploadImageData = new FormData(); + uploadImageData.append('imageFile', this.profilePic, this.profilePic.name); + this.http.post('http://localhost:9119/api/upload', uploadImageData, { observe: 'response' }) + .subscribe((res) => { + console.log(res); + if (res.status === 200) { + this.message = 'Image uploaded successfully'; + } else { + this.message = 'Image not uploaded successfully'; + } + } + ); + }*/ + + + onSubmit() { + this.updated = true; + this.update(); + } + imageChangedEvent: any = ''; + croppedImage: any = ''; + canvasRotation = 0; + rotation = 0; + scale = 1; + showCropper = false; + containWithinAspectRatio = false; + fileChangeEvent(event: any): void { + this.imageChangedEvent = event; + } + imageCropped(event: ImageCroppedEvent) { + this.croppedImage = event.base64; + this.profilePic=this.croppedImage; + + } + imageLoaded() { + this.showCropper = true; + console.log('Image loaded'); + } + + cropperReady(sourceImageDimensions: Dimensions) { + console.log('Cropper ready', sourceImageDimensions); + } + loadImageFailed() { + // show message + } + rotateLeft() { + this.canvasRotation--; + this.flipAfterRotate(); + } + + rotateRight() { + this.canvasRotation++; + this.flipAfterRotate(); + } + + private flipAfterRotate() { + const flippedH = this.transform.flipH; + const flippedV = this.transform.flipV; + this.transform = { + ...this.transform, + flipH: flippedV, + flipV: flippedH + }; + } + + + flipHorizontal() { + this.transform = { + ...this.transform, + flipH: !this.transform.flipH + }; + } + + flipVertical() { + this.transform = { + ...this.transform, + flipV: !this.transform.flipV + }; + } + zoomOut() { + this.scale -= .1; + this.transform = { + ...this.transform, + scale: this.scale + }; +} + +zoomIn() { + this.scale += .1; + this.transform = { + ...this.transform, + scale: this.scale + }; +} + +toggleContainWithinAspectRatio() { + this.containWithinAspectRatio = !this.containWithinAspectRatio; +} + +updateRotation() { + this.transform = { + ...this.transform, + rotate: this.rotation + }; +} +openmodal(){ + this.model=true; +} +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.html new file mode 100644 index 0000000..c287cb4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.html @@ -0,0 +1,99 @@ + + + + +
+
+
+

Session Logger

+
+
+ + + +
+
+ + + + + + + + + Loading ... +
{{error}}
+ + + Client Ip + + + lastAccessDate + + + Log In Time + + + Log Out Time + + + Session Id + + + User Id + + + User Name + + + + + + + + {{user.clientIp}} + {{user.lastAccessDate}} + {{user.logintime}} + {{user.logouttime}} + {{user.sessionId}} + {{user.userId.userId}} + {{user.userId.username}} + + + + + + + + + + + + + Record per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} Records + + +
+
+ + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.scss new file mode 100644 index 0000000..76ab29b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.scss @@ -0,0 +1,4 @@ +.delete,.heading{ + text-align: center; + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.spec.ts new file mode 100644 index 0000000..149e2eb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SessionloggerComponent } from './sessionlogger.component'; + +describe('SessionloggerComponent', () => { + let component: SessionloggerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ SessionloggerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(SessionloggerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.ts new file mode 100644 index 0000000..4ffab36 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/sessionlogger/sessionlogger.component.ts @@ -0,0 +1,69 @@ +import { Component, OnInit } from '@angular/core'; +import { SessionloggerService } from 'src/app/services/admin/sessionlogger.service'; +import * as moment from 'moment'; +import { ExcelService } from 'src/app/services/excel.service'; +import { ToastrService } from 'ngx-toastr'; +import { HttpErrorResponse } from '@angular/common/http'; +@Component({ + selector: 'app-sessionlogger', + templateUrl: './sessionlogger.component.html', + styleUrls: ['./sessionlogger.component.scss'] +}) +export class SessionloggerComponent implements OnInit { + loading = false; + error; + data; + modaldelete=false; + rowSelected :any= {}; + constructor(private sessionservice:SessionloggerService,private excel: ExcelService, + private toastr: ToastrService,) { } + + ngOnInit(): void { + this.getdata(); + } + getdata(){ + this.sessionservice.getAll().subscribe((data)=>{ + this.data=data; + console.log(this.data); + if(this.data.length==0){ + this.error="No data Available plz add if Required"; + console.log(this.error) + } + },(error) => { + console.log(error); + if(error){ + this.error="server Error"; + } + }); + + + } + onExport(){ + this.excel.exportAsExcelFile(this.data, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + modaldel(row){ + this.rowSelected = row; + this.modaldelete=true; + console.log(this.rowSelected); + } + delete(id) + { + console.log("in delete "+id); + this.sessionservice.delete(id).subscribe( + (data) => { + console.log(data); + //this.ngOnInit(); + },(error:HttpErrorResponse) => { + console.log(error); + if(error.status==200){ + this.toastr.success(error.error.text); + } + if(error.status==404){ + this.toastr.error(error.error); + } + + }); + this.modaldelete=false; + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.html new file mode 100644 index 0000000..4a5da87 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.html @@ -0,0 +1,311 @@ + + + + + +
+
+
+
+

Sub-Menu Maintenance

+

Sub Menu

+
+
+
+ +
+
+ +
+
+ +
+
+ +
+ + +
+
+
+ + + +
+ + Loading ... + + + NO. + + + Sub-Menu Item Name + + + ID + + + Sequence + + + Module Name + + + Menu Action Link + + + Status + + + + {{i+1}} + +
+ +
+
{{user.menuItemDesc}}
+
ID: {{ user.menuId || '—' }} | Seq: {{ (user.itemSeq === 0 || user.itemSeq) ? user.itemSeq : '—' }}
+
+
+
+ {{user.menuId}} + {{user.itemSeq}} + {{user.moduleName}} + {{user.main_menu_action_name}} + {{user.status}} + + +
+ + +
+
+ + + + + + + +
Menu Name: {{user.menuItemDesc}}
+
+
+ + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ +
+
+
+
+ +
{{user.menuItemDesc}}
+
{{user.status}}
+
+
+
ID{{ user.menuId || '—' }}
+
Sequence{{ (user.itemSeq === 0 || user.itemSeq) ? user.itemSeq : '—' }}
+
Module{{ user.moduleName || '—' }}
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.scss new file mode 100644 index 0000000..c4061f4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.scss @@ -0,0 +1,147 @@ +@import '../../../../../styles/design-tokens'; + +.mm-breadcrumb { margin-bottom: 0.75rem; } +.mm-modal .modal-body { background: var(--theme-surface); } +.mm-modal .modal-title { font-weight: 600; } +.mm-modal .modal-body .clr-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; } +@media (max-width: 640px) { .mm-modal .modal-body .clr-row { grid-template-columns: 1fr; } } +.mm-modal label { display: inline-block; margin-bottom: 6px; font-weight: 600; color: var(--theme-text); } +.mm-modal input.clr-input, .mm-modal select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.12); background: var(--theme-background); transition: border-color 150ms ease, box-shadow 150ms ease; } +.mm-modal input.clr-input:focus, .mm-modal select:focus { outline: none; border-color: var(--theme-primary); box-shadow: 0 0 0 3px var(--theme-primary-100); } +.mm-modal .modal-footer { display: flex; justify-content: flex-end; gap: 10px; } +.mm-modal .modal-footer .btn.btn-primary { background: var(--theme-primary); color: #fff; border-radius: 10px; } +.mm-modal .modal-footer .btn.btn-outline { border-radius: 10px; border: 1px solid var(--theme-secondary); color: var(--theme-secondary); } +.mm-modal .error_mess { color: #ef4444; font-size: 12px; margin-top: 4px; } + +.mm-hero { + display: flex; justify-content: space-between; align-items: center; + background: var(--theme-glass-bg); backdrop-filter: blur(12px); + border: 1px solid var(--theme-glass-border); + border-radius: calc(var(--theme-border-radius) + 4px); + padding: 1rem 1.25rem; margin-bottom: 0.75rem; box-shadow: var(--theme-glass-shadow); +} +.mm-hero__content { display: flex; align-items: center; gap: 0.75rem; } +.mm-hero__icon clr-icon { width: 28px; height: 28px; color: var(--theme-primary); } +.mm-hero__title { font-size: 1.25rem; margin: 0; } +.mm-hero__subtitle { margin: 0; font-size: 0.875rem; color: var(--theme-text-secondary); } +.mm-hero__actions .btn + .btn { margin-left: 0.5rem; } + +.mm-btn-primary { border-radius: var(--theme-border-radius); background: var(--theme-primary); color: #fff; } +.mm-btn-text { margin-left: 0.35rem; } + +.mm-toolbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--theme-surface); border: 1px solid rgba(0,0,0,0.05); border-radius: var(--theme-border-radius); box-shadow: 0 1px 0 rgba(0,0,0,0.03); } +.mm-search { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(0,0,0,0.08); padding: 6px 8px; border-radius: 999px; background: var(--theme-background); } +.mm-search__input { border: none; outline: none; background: transparent; min-width: 220px; } +.mm-select { border-radius: 999px; padding: 6px 10px; border: 1px solid rgba(0,0,0,0.08); background: var(--theme-background); } +.mm-view-toggle .btn { margin-left: 6px; border-radius: 999px; } + +.mm-card { background: var(--theme-glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--theme-glass-border); border-radius: var(--theme-border-radius); padding: 0.25rem; } +.mm-grid { background: var(--theme-surface); border-radius: var(--theme-border-radius); box-shadow: var(--theme-shadow); } +.mm-grid--modern .datagrid-header { background: linear-gradient(135deg, var(--theme-primary-50), transparent); } +.mm-grid-footer { border-top: 1px solid rgba(0,0,0,0.06); } +.mm-row:hover { background: var(--theme-primary-50); } +.mm-item { display: flex; align-items: center; gap: 0.75rem; } +.mm-item__avatar clr-icon { width: 18px; height: 18px; color: var(--theme-accent); } +.mm-item__title { font-weight: 600; } +.mm-item__meta { font-size: 0.75rem; color: var(--theme-text-secondary); } +.mm-actions-inline .btn { margin-right: 6px; } +.mm-actions-inline .mm-btn-edit { border: 1px solid var(--theme-accent); color: var(--theme-accent); } +.mm-actions-inline .mm-btn-edit:hover { background: rgba(139, 92, 246, 0.12); } +.mm-actions-inline .mm-btn-delete { border: 1px solid #ef4444; color: #ef4444; } +.mm-actions-inline .mm-btn-delete:hover { background: rgba(239, 68, 68, 0.12); } + +.mm-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } +@media (max-width: 1024px) { .mm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } } +@media (max-width: 640px) { .mm-cards { grid-template-columns: 1fr; } .mm-search__input { min-width: 140px; } } +.mm-card-item { background: var(--theme-surface); border: 1px solid rgba(0,0,0,0.06); border-radius: var(--theme-border-radius); box-shadow: var(--theme-shadow); overflow: hidden; display: flex; flex-direction: column; } +.mm-card-item__header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(135deg, var(--theme-primary-50), transparent); } +.mm-card-item__icon clr-icon { color: var(--theme-primary); width: 18px; height: 18px; } +.mm-card-item__title { font-weight: 700; flex: 1 1 auto; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.mm-card-item__badge { margin-left: auto; } +.mm-card-item__body { padding: 10px 12px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; } +@media (max-width: 640px) { .mm-card-item__body { grid-template-columns: 1fr; } } +.mm-kv { display: flex; justify-content: space-between; } +.mm-kv span { color: var(--theme-text-secondary); } +.mm-card-item__footer { padding: 10px 12px; display: flex; gap: 8px; border-top: 1px solid rgba(0,0,0,0.06); } +.mm-card-item__footer .mm-btn-edit { border: 1px solid var(--theme-accent); color: var(--theme-accent); } +.mm-card-item__footer .mm-btn-edit:hover { background: rgba(139, 92, 246, 0.12); } +.mm-card-item__footer .mm-btn-delete { border: 1px solid #ef4444; color: #ef4444; } +.mm-card-item__footer .mm-btn-delete:hover { background: rgba(239, 68, 68, 0.12); } +.mm-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--theme-secondary); color: #fff; font-size: 0.75rem; } +.mm-badge--success { background: var(--theme-primary); } +.mm-badge--muted { background: var(--theme-primary-200); color: var(--theme-text); } + +/* Modals */ +.mm-modal .modal-body { background: var(--theme-surface); } +.mm-modal .modal-title { font-weight: 600; } +.mm-modal .modal-body .clr-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; } +@media (max-width: 640px) { .mm-modal .modal-body .clr-row { grid-template-columns: 1fr; } } +.mm-modal label { display: inline-block; margin-bottom: 6px; font-weight: 600; color: var(--theme-text); } +.mm-modal input.clr-input, .mm-modal select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.12); background: var(--theme-background); transition: border-color 150ms ease, box-shadow 150ms ease; } +.mm-modal input.clr-input:focus, .mm-modal select:focus { outline: none; border-color: var(--theme-primary); box-shadow: 0 0 0 3px var(--theme-primary-100); } +.mm-modal .modal-footer { display: flex; justify-content: flex-end; gap: 10px; } +.mm-modal .modal-footer .btn.btn-primary { background: var(--theme-primary); color: #fff; border-radius: 10px; } +.mm-modal .modal-footer .btn.btn-outline { border-radius: 10px; border: 1px solid var(--theme-secondary); color: var(--theme-secondary); } +.mm-modal .error_mess { color: #ef4444; font-size: 12px; margin-top: 4px; } +input[type=text],[type=date],[type=password],[type=number] { + width: 100%; + padding: 15px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + //background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.spec.ts new file mode 100644 index 0000000..6d85802 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SubmenuComponent } from './submenu.component'; + +describe('SubmenuComponent', () => { + let component: SubmenuComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ SubmenuComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(SubmenuComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.ts new file mode 100644 index 0000000..5893b4a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/submenu/submenu.component.ts @@ -0,0 +1,186 @@ +import { Component, OnInit } from '@angular/core'; +import { ThemeService } from 'src/app/services/theme.service'; +import { MenumaintanceService } from '../../../../services/admin/menumaintance.service'; +import { Rn_Main_Menu } from '../../../../models/builder/Rn_Main_Menu'; +import { ActivatedRoute, Router } from '@angular/router'; +import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ToastrService } from 'ngx-toastr'; + + +function numberValidator(control: AbstractControl): { [key: string]: any } | null { + const value = control.value; + return isNaN(value) ? { 'notANumber': { value } } : null; +} + +@Component({ + selector: 'app-submenu', + templateUrl: './submenu.component.html', + styleUrls: ['./submenu.component.scss'] +}) +export class SubmenuComponent implements OnInit { + loading = false; + modalAdd = false; + modaledit = false; + modaldelete = false; + selected: any[] = []; + rowSelected: any = {}; + givendata; + menus: Rn_Main_Menu[]; + sub; + id; + mainid; + submitted = false; + public entryForm: FormGroup; + // UI filter/view state + filterText = ''; + statusFilter: 'All' | 'Enable' | 'Disable' | '' = 'All'; + viewMode: 'cards' | 'table' = 'cards'; + + constructor(private menuservice: MenumaintanceService, + private toastr: ToastrService, + private _fb: FormBuilder, + private route: ActivatedRoute, + private router: Router, + private themeService: ThemeService) { } + + ngOnInit(): void { + this.themeService.currentTheme$.subscribe(() => { + // Theme CSS variables applied globally + }); + this.id = this.route.snapshot.params["id"]; + console.log("project mainmenu with id = ", this.id); + this.getById(this.id); + this.mainid = this.id + this.entryForm = this._fb.group({ + // menuItemId:[null], + menuId: [this.mainid], + menuItemDesc: ['', [Validators.required]], + // itemSeq:['',[Validators.required]] , + // itemSeq: ['', [Validators.required, numberValidator]], + itemSeq: ['', [Validators.required, Validators.pattern('^[0-9]*$')]], + moduleName: ['', [Validators.required]], + status: ['', [Validators.required]], + main_menu_action_name: ['', [Validators.required]] + }); + + // this.getdata(); + } + + // Derived/filtered list for view + get filteredSubMenus(): any[] { + const items: any[] = (this.sub as unknown as any[]) || []; + const text = (this.filterText || '').toLowerCase(); + const status = this.statusFilter; + return items.filter(m => { + const matchText = !text || ( + (m.menuItemDesc || '').toLowerCase().includes(text) || + (m.moduleName || '').toLowerCase().includes(text) || + (m.main_menu_action_name || '').toLowerCase().includes(text) + ); + const matchStatus = !status || status === 'All' || m.status === status; + return matchText && matchStatus; + }); + } + + setViewMode(mode: 'cards' | 'table') { this.viewMode = mode; } + + // Resolve a safe icon + getIconShape(menu: any): string { + const raw = (menu?.main_menu_icon_name ?? menu?.mainMenuIconName ?? '').toString().trim(); + const name = raw.toLowerCase(); + const invalid = !name || name === 'undefined' || name === 'null' || name === '-' || name === 'na' || name === 'n/a'; + if (invalid) return 'file'; + const alias: Record = { application:'application', applications:'applications', settings:'cog', config:'cog', user:'user', users:'users', folder:'folder', file:'file', tag:'tag', bookmark:'bookmark', home:'home', dashboard:'dashboard', menu:'list', list:'list', link:'link', module:'application' }; + return alias[name] ?? name; + } + getById(id: any) { + this.menuservice.getbyid(id).subscribe((data) => { + this.sub = data; + console.log(this.sub) + }) + } + getdata() { + this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => { + this.menus = resp; + console.log('menus: ', this.menus); + }) + } + goToAdd() { + this.modalAdd = true; + } + onSubmit() { + this.submitted = true; + if (this.entryForm.invalid) { + return; + } + this.menuservice.create1(this.entryForm.value).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Added successfully'); + this.ngOnInit(); + } + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not added Data Getting Some Error'); + } + this.ngOnInit(); + + + }); + this.modalAdd = false; + } + + goToEdit(row) { + this.rowSelected = row; + console.log(row) + this.modaledit = true; + //this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.menuservice.delete1(id).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Deleted successfully'); + } + this.ngOnInit(); + + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + this.ngOnInit(); + + }); + + } + onUpdate(id) { + this.modaledit = false; + this.menuservice.update1(id, this.rowSelected).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Updated successfully'); + this.ngOnInit(); + + } + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not updated Data Getting Some Error'); + } + this.ngOnInit(); + + }); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.html new file mode 100644 index 0000000..bd23988 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.html @@ -0,0 +1,665 @@ + + + + + + + + + + +

{{ 'editMode' | translate }}

+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ +
+
+ + + +
+
diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.scss new file mode 100644 index 0000000..5037b31 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.scss @@ -0,0 +1,86 @@ +.name{ + background-color:#c5c9b0; + color: white; + font-size: 15px; +} +// input[type=text],[type=date],[type=datetime-local],textarea { +// height: 30px; +// width: 100%; +// // padding: 15px 15px; +// // //margin: 2px 0; +// // display: inline-block; +// // border: 1px solid #ccc; +// // border-radius: 4px; +// // box-sizing: border-box; +// } +clr-icon{ + margin-left: 5px; +} +.one-line { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 300px; +} +input[type=text], select, textarea { + width: 100%; + padding: 5px; + border: 1px solid #ccc; + border-radius: 4px; + resize: vertical; +} + +label { + padding: 12px 12px 12px 0; + display: inline-block; +} + +input[type=submit] { + // background-color: #04AA6D; + color: white; + padding: 12px 20px; + border: none; + border-radius: 4px; + cursor: pointer; + float: right; +} + +input[type=submit]:hover { + background-color: #45a049; +} + +.container { + border-radius: 5px; + //background-color: #f2f2f2; + padding: 20px; +} + +.col-25 { + float: left; + width: 25%; + margin-top: 5px; +} + +.col-75 { + float: left; + width: 75%; + margin-top: 5px; +} + +/* Clear floats after the columns */ +.row:after { + content: ""; + display: table; + clear: both; +} + +/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */ +@media screen and (max-width: 600px) { + .col-25, .col-75, input[type=submit] { + width: 100%; + margin-top: 0; + } +} +.btn{ + float: right; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.spec.ts new file mode 100644 index 0000000..6eff4ca --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SystemparametersComponent } from './systemparameters.component'; + +describe('SystemparametersComponent', () => { + let component: SystemparametersComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ SystemparametersComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(SystemparametersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.ts new file mode 100644 index 0000000..107b8ba --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/systemparameters/systemparameters.component.ts @@ -0,0 +1,114 @@ +import { HttpEventType } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { AlertService } from 'src/app/services/alert.service'; +import {SysparameterService} from 'src/app/services/admin/sysparameter.service'; +import { FormBuilder, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import {Systemparameter} from 'src/app/models/admin/systemparameter' +import { ToastrService } from 'ngx-toastr'; + +@Component({ + selector: 'app-systemparameters', + templateUrl: './systemparameters.component.html', + styleUrls: ['./systemparameters.component.scss'], + +}) +export class SystemparametersComponent implements OnInit { + public profilePic: File = null; + message: string; + image: any; + selectedFile: File[]=[]; + public entryForm: FormGroup; + project: Systemparameter; + id=1; + constructor(private alertService: AlertService, + private sysparaservice:SysparameterService, + private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private toastr: ToastrService,) { } + + ngOnInit(): void { + this.project = new Systemparameter(); + this.getById(this.id); + + this.entryForm = this._fb.group({ + schedulerTime: [null], + leaseTaxCode: [null], + vesselConfProcessLimit: [null], + rowToDisplay: [null], + linkToDisplay: [null], + rowToAdd: [null], + lovRowToDisplay: [null], + lovLinkToDisplay: [null], + oidserverName: [null], + oidBase: [null], + oidAdminUser: [null], + oidServerPort: [null], + userDefaultGroup: [null], + defaultDepartment: [null], + defaultPosition: [null], + singleCharge: [null], + firstDayOftheWeek: [null], + hourPerShift: [null], + cnBillingFrequency: [null], + billingDepartmentCode: [null], + basePriceList: [null], + nonContainerServiceOrder: [null], + ediMaeSchedulerONOFF: [null], + ediSchedulerONOFF: [null], + upload_Logo:[null], + Company_Display_Name:[null] + }); + + } + public onFileChanged(event) { + for (var i = 0; i < event.target.files.length; i++) { + this.selectedFile.push(event.target.files[i]); + } + } + // onSubmit(){ + // this.userObj.status='P'; + // console.log(this.entryForm.value); + // this.mainService.createall(this.entryForm.value,this.selectedFile).subscribe(data => { + // console.log(data) + + // }, + // (error) => { + // console.log(error); + // } + + // ); + // } + adddata(){ + this.sysparaservice.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + // this.router.navigate(["../../project/all"], { relativeTo: this.route }); + }, + + ); + } + getById(id: number) { + this.sysparaservice.getById(id).subscribe((data) => { + this.project = data; + console.log("getbyiddata",this.project); + }, + (err) => { + console.log(err); + } + ); + } + updatedata(){ + this.sysparaservice.update(this.id, this.project,this.selectedFile).subscribe( + (data) => { + console.log(data); + //this.router.navigate(["../../../project/all"], { relativeTo: this.route }); + }, + + ); + if (this.id) { + this.toastr.success('Updated successfully'); + } + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.html new file mode 100644 index 0000000..d8c3c77 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.html @@ -0,0 +1,42 @@ + + + +
+
+ CloudnSure +
+
+
+ + +
+ + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.scss new file mode 100644 index 0000000..dbaa7f7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.scss @@ -0,0 +1,143 @@ +//@import "../../../assets/scss/var"; +/* :host { + display: flex; + flex-direction: row; + justify-content: center; +} */ + +/* .s-login-pg { + width:400px; + display:flex; + padding:0; + margin:48px 16px 16px 16px; + flex-direction: column; + align-items: center; + background-color: white; + border: 1px solid #ccc; + border-radius: 2px; + box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.15); + .s-login-pg-head{ + width:100%; + height:220px; + display:flex; + flex-direction: column; + align-items: center; + background-color: #998; + padding:16px; + color:white; + } + .s-login-pg-form { + width:100%; + height:200px; + display:flex; + flex-direction: column; + align-items: center; + margin:24px 16px; + input{ + margin: 16px; + } + } + .s-login-pg-foot { + width:100%; + min-height:40px; + display:flex; + flex-direction: column; + align-items: center; + } + + +} */ + +//** variables +$background: #f5f6fa; +$text: #9c9c9c; +$input-bg-color: #fff; +$input-text-color: #a3a3a3; +$button-bg-color: #7f8ff4; +$button-text-color: #fff; + +//** root +:root { + background: $background; + color: $text; + font: 1rem "PT Sans", sans-serif; +} + +html, +body, +.container { + height: 100%; +} + +a { + color: inherit; + + &:hover { + color: $button-bg-color; + } +} + +//** helper +.email_check { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.uppercase { + text-transform: uppercase; +} + +//** button +.btn { + display: inline-block; + background: transparent; + color: inherit; + font: inherit; + border: 0; + outline: 0; + padding: 0; + transition: all 200ms ease-in; + cursor: pointer; + + &--primary { + background: $button-bg-color; + color: $button-text-color; + box-shadow: 0 0 10px 2px rgba(0, 0, 0, .1); + border-radius: 2px; + //padding: 12px 36px; + //padding: 7px 158px; + width: 100%; + + &:hover { + background: darken($button-bg-color, 4%); + } + + &:active { + background: $button-bg-color; + box-shadow: inset 0 0 10px 2px rgba(0, 0, 0, .2); + } + } + + /* &--inside { + margin-left: -96px; + } */ +} + +//** form +.form { + /* margin-left: auto; + margin-right: auto; */ + &__field { + width: 360px; + //width: 450px; + background: #fff; + color: $input-text-color; + font: inherit; + box-shadow: 0 6px 10px 0 rgba(0, 0, 0 , .1); + border: 0; + outline: 0; + padding: 22px 18px; + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.spec.ts new file mode 100644 index 0000000..692a6ca --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserRegistrationComponent } from './user-registration.component'; + +describe('UserRegistrationComponent', () => { + let component: UserRegistrationComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ UserRegistrationComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(UserRegistrationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.ts new file mode 100644 index 0000000..52e1126 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/user-registration/user-registration.component.ts @@ -0,0 +1,93 @@ + +import { HttpErrorResponse } from "@angular/common/http"; +import { Component, OnInit, ViewEncapsulation } from "@angular/core"; +import { FormArray, FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { ActivatedRoute, Router } from "@angular/router"; + + +import { UserRegistrationService } from "src/app/services/admin/user-registration.service"; + + +export interface EmailRequest { + email: string; +} +@Component({ + selector: 'app-user-registration', + templateUrl: './user-registration.component.html', + styleUrls: ['./user-registration.component.scss'] +}) +export class UserRegistrationComponent implements OnInit { + + model: any = {}; + EmailRequest: EmailRequest; + emailErrMsg: string = "" + emailCheckForm: FormGroup; + constructor(private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private userRegistrationService: UserRegistrationService) { } + + ngOnInit(): void { + this.userRegistrationService.removeSignedUpUserInfo(); + this.userRegistrationService.removeStoredEmail(); + this.emailCheckForm = this._fb.group({ + email: ['', Validators.email] + }); + } + emailExistCheck() { + console.log('input email: ', this.model.email); + this.userRegistrationService.emailCheck(this.model.email) + .subscribe((res) => { + console.log('email check Res : ', res); + /* if(res == 202) { + this.emailErrMsg = res.body; + // redirect to next page + //this.router.navigate([""]) + } else if(res.status == 409){ + this.emailErrMsg = res.body; + } */ + }, (err) => { + console.log(err); + }); + } + + + get f() { return this.emailCheckForm.controls; } + onSubmit() { + console.log('this.emailCheckForm.value : ', this.emailCheckForm.value); + /* let headers = new HttpHeaders().set("Content-Type", "application/json"); + this.httpService.post('http://localhost:9119/token/email-exists', + JSON.stringify(this.emailCheckForm.value), { headers: headers, responseType: 'text' }) + .subscribe(data => { + console.log('success ', data); + this.router.navigate(["/varify-account"]); + }, err => { + console.log('failure ', err); + //location.reload; + this.emailErrMsg = "Email is Already Exist"; + } + ); */ + this.userRegistrationService.emailCheck(this.emailCheckForm.value) + .subscribe((res) => { + console.log('success ', res); + let email: string = res.message; + email = email.substring(16); + console.log(email); + this.userRegistrationService.storeEmail(email); + this.router.navigate(["/varify-account"]); + },(err: HttpErrorResponse) => { + console.log(err); + console.log(err.error.message); + if(err.status === 409) { + this.emailErrMsg = 'Email Already Exists'; + } else { + this.emailErrMsg = 'Server error'; + } + }); + } + + onSignUp() { + this.router.navigate(["signup"]); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.html new file mode 100644 index 0000000..4d02174 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.html @@ -0,0 +1,606 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

User list

+
+
+ + +
+
+ + user not found! + + + User Id + + + + + Name + + + + + Username + + + + + Role + + + + + email + + + + + {{user1.userId}} + {{user1.firstName}} {{user1.lastName}} + {{user1.username}} + {{user1.role}} + {{user1.email}} + + + + + ˝ + + + + + + + + + + + + + + + + + + + + +
picture
ID{{user1.userId}}
Updated{{user1.updatedAt | date}}
Register{{user1.createdAt | date}}
+
+
+ + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.scss new file mode 100644 index 0000000..62edce4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.scss @@ -0,0 +1,40 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; +} + +.td-content { + text-align: left; +} + +img { + border: 2px solid #245; + border-radius: 5px; +} +.img-class{ + height: 100px; + width: 100px; +} + +input[type=text],[type=date],[type=password] { + width: 100%; + padding: 12px 20px; + margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.delete,.heading{ + text-align: center; + color: red; +} + +.add-pop,.heading{ + text-align: center; + color: green; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.spec.ts new file mode 100644 index 0000000..dd3b1d7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserComponent } from './user.component'; + +describe('UserComponent', () => { + let component: UserComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UserComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UserComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.ts new file mode 100644 index 0000000..f7530c4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/user/user.component.ts @@ -0,0 +1,369 @@ +import { Component, OnInit } from '@angular/core'; +import { AlertService } from '../../../../services/alert.service'; +import { ToastrService } from 'ngx-toastr'; +import { ExcelService } from './../../../../services/excel.service'; +import { MainService } from './../../../../services/main.service'; +import * as moment from 'moment'; +import { ActivatedRoute, Router } from '@angular/router'; +import { UserListService } from '../../../../services/admin/user-list.service'; +import { HttpClient } from '@angular/common/http'; +import { MenuGroupService } from '../../../../services/admin/menu-group.service'; +import { UserInfoService } from '../../../../services/user-info.service'; +import { User } from '../../../../models/admin/user'; + +@Component({ + selector: 'app-user', + templateUrl: './user.component.html', + styleUrls: ['./user.component.scss'] +}) +export class UserComponent implements OnInit { + users: any[] = []; + rowSelected: any = {}; + loading = false; + modalEdit = false; + allusers: any; + // allusers: user; + userst: User; + openAddUser = false; + modaldelete = false; + modalcreate = false; + modalup = false; + tempid: any; + assign = false; + + user = { + id: '', + user_id: '', + name: '', + gender: '', + dob: '', + email: '', + username: '', + password: '' + } + updateU = { + id: '', + user_id: '', + name: '', + gender: '', + dob: '', + email: '', + username: '', + password: '' + } + + updateU1 = { + userId: '', + email: '', + firstName: '', + lastName: '', + username: '', + password: '' + } + + // image related variables + selectedFile: File; + retrievedImage: any; + base64Data: any; + retrieveResonse: any; + message: string; + // imageName: any; + imageName = 'index.jpg'; + + groupData: any; + + userData = { + id: '', + user_id: '', + name: '', + gender: '', + dob: '', + email: '', + username: '', + password: '', + menu_group: '' + } + + constructor( + private _mg: MenuGroupService, + private mainService: MainService, + private alertService: AlertService, + private toastr: ToastrService, + private excel: ExcelService, + private router: Router, + private route: ActivatedRoute, + private _user: UserListService, + private httpClient: HttpClient, + private _ut: UserInfoService + ) { } + + ngOnInit() { + this.getUsersT(); + this.getUser(); + this.getUsers(); + + // this.getImage(); + + this._mg.getAll().subscribe( + (data: any) => { + this.groupData = data.items; + // console.log(this.groupData); + } + ); + } + + openAssignModal(id: any) { + // console.log(id); + this._user.getOne(id).subscribe( + (data: any) => { + this.userData = data; + } + ); + this.assign = true; + } + + saveAssign() { + // console.log(this.userData.menu_group); + this._user.update(this.userData).subscribe( + (data: any) => { + console.log('Assign Updated Successfully...'); + this.assign = false; + this.ngOnInit(); + } + ); + } + + async getUser() { + this.loading = true; + const result = await this.mainService.getUserTest(); + if (result.results) { + this.users = result.results; + } + this.loading = false; + } + + onEdit(row) { + + console.log(row); + this._user.getOne(row).subscribe( + (data: any) => { + this.updateU = data; + console.log(this.updateU); + + } + ); + this.modalEdit = true; + } + + del(id: any) { + this.tempid = id; + this.modaldelete = true; + } + + async onDelete() { + // const confirmed: any = await this.alertService.confirm('', 'Delete confirm?'); + // if (confirmed.value) { + // this.toastr.success('Deleted successfully'); + // // .... + // } + + this._user.deleteById(this.tempid).subscribe( + (data: any) => { + console.log('Success....'); + this.toastr.success('User deleted successfully...'); + this.modaldelete = false; + this.ngOnInit(); + + } + ); + } + + async onSave() { + const confirmed: any = await this.alertService.confirm('', 'Save confirm?'); + if (confirmed.value) { + this.toastr.success('Save successfully'); + // .... + this.modalEdit = false; + } + } + + onExport() { + this.excel.exportAsExcelFile(this.allusers, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + goToAdd() { + this.openAddUser = true; + } + + getUsers() { + this._user.getAll().subscribe( + (data: any) => { + this.allusers = data; + + this.allusers.forEach((i: any) => { + i['imgData'] = ''; + // this.getImage(i.id); + // i['imgData'] = this.retrievedImage; + + this.httpClient.get('http://localhost:9191/user_list/get/' + i.id) + .subscribe( + res => { + this.retrieveResonse = res; + this.base64Data = this.retrieveResonse.picByte; + this.retrievedImage = 'data:image/jpeg;base64,' + this.base64Data; + i['imgData'] = 'data:image/jpeg;base64,' + this.base64Data; + // console.log(this.retrievedImage); + } + ); + }); + + console.log(this.allusers); + }, + (error: any) => { + console.log('Error in loading users from server...'); + + } + ); + } + + createUserHere() { + console.log('add button clicked....'); + + this._user.add(this.user).subscribe( + (data: any) => { + this.onUpload(data.id); + console.log('added...'); + this.toastr.success('User added successfully...'); + + this.openAddUser = false; + this.ngOnInit(); + + }, + (error: any) => { + console.log(error); + + } + ); + } + + updateUser() { + console.log('button clicked: update'); + this._user.update(this.updateU).subscribe( + (data: any) => { + console.log('success...'); + this.toastr.success('User updated successfully...'); + this.modalEdit = false; + this.ngOnInit(); + }, + (error: any) => { + console.log(error); + + } + ); + } + + public onFileChanged(event) { + //Select File + this.selectedFile = event.target.files[0]; + } + + //Gets called when the user clicks on submit to upload the image + onUpload(user: any) { + console.log(this.selectedFile); + + //FormData API provides methods and properties to allow us easily prepare form data to be sent with POST HTTP requests. + const uploadImageData = new FormData(); + uploadImageData.append('imageFile', this.selectedFile, this.selectedFile.name); + uploadImageData.append('user_id', user); + + //Make a call to the Spring Boot Application to save the image + this.httpClient.post('http://localhost:9191/user_list/upload', uploadImageData, { observe: 'response' }) + .subscribe((response) => { + if (response.status === 200) { + this.message = 'Document uploaded successfully'; + } else { + this.message = 'Document not uploaded successfully'; + } + } + ); + + + } + + //Gets called when the user clicks on retieve image button to get the image from back end + getImage(id: any) { + //Make a call to Sprinf Boot to get the Image Bytes. + this.httpClient.get('http://localhost:9191/user_list/get/' + id) + .subscribe( + res => { + this.retrieveResonse = res; + this.base64Data = this.retrieveResonse.picByte; + this.retrievedImage = 'data:image/jpeg;base64,' + this.base64Data; + // console.log(this.retrievedImage); + } + ); + } + + onEditNew(id: any) { + console.log(id); + this.getOneUser(id); + this.modalEdit = true; + } + + delNew(id: any) { + this.tempid = id; + console.log(id); + + } + + openAssignModalNew(id: any) { + console.log(id); + + } + + getUsersT() { + + this.httpClient.get('http://localhost:9191/api/all-users').subscribe( + (data: any) => { + this.userst = data; + console.log(this.userst); + }, + (error: any) => { + console.log(error); + } + ); + } + + getOneUser(id: any) { + + this.httpClient.get('http://localhost:9191/api/org-users/' + id).subscribe( + (data: any) => { + this.updateU1 = data; + console.log(this.updateU1); + + }, + (er: any) => { + console.log(er); + + } + ); + } + + updateUserNew() { + this.httpClient.put('http://localhost:9191/api/org-users/' + this.updateU1.userId, this.updateU1).subscribe( + (data: any) => { + console.log('success...'); + this.toastr.success('User updated successfully...'); + this.modalEdit = false; + console.log(data); + this.ngOnInit(); + + }, + (error: any) => { + console.log(error); + + } + ); + } +} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.html new file mode 100644 index 0000000..93987f1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.html @@ -0,0 +1,320 @@ + + +
+
+
+
+

{{'USER_GROUP_MAINTENANCE' | translate}}

+

{{ 'SECURITY' | translate }}

+
+
+
+ + + + + +
+
+ +
+
+ +
+
+
+ + +
+
+
+ + + + + {{'LOADING' | translate}} ... + +
{{error}}
+
+ + + + {{'USERGROUP_NO' | translate}} + + + + + + {{'GROUP_NAME' | translate}} + + + + + {{'GROUP_DESC' | translate}} + + + + + {{'GROUP_LEVEL' | translate}} + + + + + {{'STATUS' | translate}} + + + + + {{'UPDATED_DATE' | translate}} + + + + + {{user.usrGrp}} + {{user.groupName}} + {{user.groupDesc}} + {{user.groupLevel}} + + + {{user.status === 'E' ? 'Enabled' : 'Disabled'}} + + + {{user.updateDateFormated}} + + + + + + + + + + + + + +
username{{user.groupName}}
+
+
+ + + + Record per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} Records + + +
+ +
+
+
+
+ +
{{user.groupName}}
+
+ {{user.status === 'E' ? 'Enabled' : 'Disabled'}} +
+
+
+
ID{{user.usrGrp}}
+
Desc{{user.groupDesc}}
+
Level{{user.groupLevel}}
+
Updated{{user.updateDateFormated}}
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.scss new file mode 100644 index 0000000..d903195 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.scss @@ -0,0 +1,748 @@ +@import '../../../../../styles.scss'; + +// Import design tokens +@import '../../../../../styles/design-tokens'; + +// User Group Maintenance Styles +.ug-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + font-family: var(--theme-font-primary); + + &__content { + display: flex; + align-items: center; + gap: 16px; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 16px; + display: flex; + align-items: center; + justify-content: center; + + clr-icon { + width: 36px; + height: 36px; + color: white; + } + } + + &__title { + font-size: 28px; + font-weight: 700; + margin: 0; + color: white; + font-family: var(--theme-font-secondary); + } + + &__subtitle { + font-size: 16px; + margin: 0; + opacity: 0.9; + color: rgba(255, 255, 255, 0.8); + } + + &__actions { + display: flex; + gap: 12px; + } +} + +.ug-btn-text { + margin-left: 8px; +} + +// Modern Button Styles using ThemeService +.ug-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + font-size: 14px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; + + &:focus { + outline: 2px solid var(--theme-primary); + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + // Sizes + &.ug-btn-sm { + padding: 8px 16px; + font-size: 13px; + height: 32px; + } + + &.ug-btn-md { + padding: 12px 20px; + font-size: 14px; + height: 40px; + } + + &.ug-btn-lg { + padding: 16px 24px; + font-size: 16px; + height: 48px; + } + + // Variants + &.ug-btn-primary { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-color: var(--theme-primary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: linear-gradient(135deg, var(--theme-primary, #0284c7) 0%, var(--theme-accent, #7c3aed) 100%); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + + &:active { + transform: translateY(0); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + } + + &.ug-btn-secondary { + background: var(--theme-surface); + color: var(--theme-text); + border-color: rgba(0, 0, 0, 0.1); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-background); + border-color: rgba(0, 0, 0, 0.2); + transform: translateY(-1px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.ug-btn-outline { + background: transparent; + color: var(--theme-secondary); + border-color: var(--theme-secondary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: rgba(100, 116, 139, 0.1); // var(--theme-secondary) with 10% opacity + border-color: var(--theme-secondary); + color: var(--theme-secondary); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.ug-btn-error { + background: var(--theme-error, #ef4444); + color: white; + border-color: var(--theme-error, #ef4444); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.1); + } + } + + &.ug-btn-ghost { + background: transparent; + color: var(--theme-text-secondary); + border-color: transparent; + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } + } +} + +.ug-toolbar { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + padding: 16px; + background: var(--theme-surface); + border-radius: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &__left { + flex: 1; + } + + &__right { + display: flex; + gap: 8px; + } +} + +.ug-search { + position: relative; + max-width: 400px; + + clr-icon { + position: absolute; + left: 12px; + top: 50%; + transform: translateY(-50%); + color: #9ca3af; + z-index: 1; + } + + &__input { + width: 100%; + padding: 12px 12px 12px 40px; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + font-size: 14px; + transition: all 200ms ease-out; + background: var(--theme-surface); + color: var(--theme-text); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); // var(--theme-primary) with 10% opacity + } + } +} + +.ug-view-toggle { + display: flex; + border: 1px solid #d1d5db; + border-radius: 8px; + overflow: hidden; + + .ug-btn { + border-radius: 0; + border: none; + background: var(--theme-surface); + color: var(--theme-text-secondary); + + &:first-child { + border-right: 1px solid #d1d5db; + } + + &.ug-btn-primary { + background: var(--theme-primary); + color: white; + } + } +} + +// Modern Table Styles +.ug-grid { + background: var(--theme-surface); + border-radius: 16px; + overflow: hidden; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + + ::ng-deep .datagrid { + .datagrid-head { + background: var(--theme-background); + + .datagrid-column { + padding: 16px 24px; + font-size: 12px; + font-weight: 600; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid #e5e7eb; + } + } + + .datagrid-row { + transition: background-color 150ms ease-out; + + &:hover { + background: var(--theme-background); + } + + &:not(:last-child) { + border-bottom: 1px solid #e5e7eb; + } + + .datagrid-cell { + padding: 16px 24px; + font-size: 14px; + color: var(--theme-text); + } + } + + .datagrid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; + padding: 16px 24px; + } + } +} + +.ug-grid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; +} + +// Modern Card Styles - More beautiful design +.ug-cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); + gap: 24px; + margin-bottom: 24px; +} + +.ug-card-item { + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.06); + border-radius: var(--theme-border-radius); // Using theme variable + box-shadow: var(--theme-shadow); // Using theme variable + overflow: hidden; + display: flex; + flex-direction: column; + transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); + + &:hover { + transform: translateY(-5px); + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); + border-color: rgba(14, 165, 233, 0.3); // var(--theme-primary) with 30% opacity + } + + &__header { + display: flex; + align-items: center; + gap: 10px; + padding: 16px; + background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), transparent); // var(--theme-primary) with 10% opacity + min-height: 60px; + } + + &__icon { + clr-icon { + width: 24px; + height: 24px; + color: var(--theme-primary); + } + } + + &__title { + font-weight: 700; + flex: 1 1 auto; + font-size: 18px; + color: var(--theme-text); + max-width: 60%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + &__badge { + margin-left: auto; + display: inline-flex; + align-items: center; + padding: 4px 12px; + font-size: 12px; + font-weight: 600; + border-radius: 9999px; + text-transform: uppercase; + letter-spacing: 0.05em; + } + + &__body { + padding: 16px; + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px; + } + + &__footer { + padding: 16px; + display: flex; + gap: 8px; + border-top: 1px solid rgba(0, 0, 0, 0.06); + background: var(--theme-background); + } +} + +.ug-kv { + display: flex; + justify-content: space-between; + font-size: 14px; + + span { + color: var(--theme-text-secondary); + } + + strong { + color: var(--theme-text); + font-weight: 500; + text-align: right; + max-width: 60%; + overflow: hidden; + text-overflow: ellipsis; + } +} + +// Theme the card footer buttons +.ug-card-item__footer .ug-btn { + border-radius: 10px; + flex: 1; + justify-content: center; +} + +.ug-card-item__footer .ug-btn.ug-btn-outline { + border: 1px solid var(--theme-secondary); + color: var(--theme-secondary); + background: transparent; + + &:hover { + background: rgba(100, 116, 139, 0.1); // var(--theme-secondary) with 10% opacity + border-color: var(--theme-secondary); + color: var(--theme-secondary); + } +} + +.ug-card-item__footer .ug-btn.ug-btn-error { + background: var(--theme-error, #ef4444); + color: #fff; + border-color: var(--theme-error, #ef4444); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + } +} + +// Table view action buttons +.ug-action-item { + @extend .ug-btn; + @extend .ug-btn-ghost; + @extend .ug-btn-sm; + width: 100%; + justify-content: flex-start; + margin-bottom: 4px; + text-align: left; + + clr-icon { + width: 16px; + height: 16px; + margin-right: 8px; + } + + &.ug-btn-error { + color: var(--theme-error, #ef4444); + + &:hover { + background: rgba(239, 68, 68, 0.1); + } + } +} + +// Ensure action overflow is visible +::ng-deep .datagrid-action-overflow { + button.action-item { + display: flex; + align-items: center; + width: 100%; + text-align: left; + padding: 8px 12px; + + clr-icon { + margin-right: 8px; + } + } +} + +// Status Badges +.ug-status-badge { + display: inline-flex; + align-items: center; + padding: 6px 16px; + font-size: 13px; + font-weight: 600; + border-radius: 9999px; + text-transform: uppercase; + letter-spacing: 0.05em; +} + +.ug-status-enabled { + background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%); + color: #10b981; +} + +.ug-status-disabled { + background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%); + color: #ef4444; +} + +// Form Styles +.ug-form-group { + margin-bottom: 20px; +} + +.ug-form-label { + display: block; + font-size: 14px; + font-weight: 500; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); +} + +.ug-form-input, .ug-form-select { + width: 100%; + padding: 12px 16px; + font-size: 14px; + line-height: 1.5; + color: var(--theme-text); + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + transition: all 200ms ease-out; + margin-bottom: 0; + font-family: var(--theme-font-primary); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); // var(--theme-primary) with 10% opacity + } + + &:disabled { + background: var(--theme-background); + color: var(--theme-text-secondary); + cursor: not-allowed; + } + + &.error { + border-color: #ef4444; + box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); + } + + &::placeholder { + color: var(--theme-text-secondary); + } +} + +.ug-form-select { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e"); + background-position: right 12px center; + background-repeat: no-repeat; + background-size: 16px 12px; + padding-right: 40px; + appearance: none; +} + +.ug-form-error { + color: #ef4444; + font-size: 12px; + margin-top: 6px; + font-weight: 500; +} + +.required-field { + color: #ef4444; + margin-left: 4px; +} + +.ug-file-input { + width: 100%; + padding: 12px; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + background: var(--theme-surface); + color: var(--theme-text); + + &::file-selector-button { + @extend .ug-btn; + @extend .ug-btn-secondary; + margin-right: 12px; + padding: 8px 16px; + border: none; + } +} + +// Delete Modal Styles +.ug-delete-header { + text-align: center; + padding: 24px; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.ug-delete-icon { + color: #ef4444; + margin-bottom: 16px; +} + +.ug-delete-title { + font-size: 24px; + font-weight: 700; + color: var(--theme-text); + margin: 0 0 8px 0; +} + +.ug-delete-subtitle { + font-size: 16px; + color: var(--theme-text-secondary); + margin: 0; +} + +.ug-delete-details { + padding: 24px; +} + +.ug-delete-detail-item { + display: flex; + justify-content: space-between; + padding: 12px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + + &:last-child { + border-bottom: none; + } +} + +.ug-delete-detail-label { + font-weight: 500; + color: var(--theme-text-secondary); +} + +.ug-delete-detail-value { + font-weight: 600; + color: var(--theme-text); +} + +.delete { + color: #ef4444; + text-align: center; + margin-bottom: 16px; + font-weight: 600; + font-size: 20px; +} + +.heading { + text-align: center; + margin-bottom: 24px; + color: var(--theme-text); + font-weight: 600; +} + +// Modal Header +::ng-deep .modal-header { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px 16px 0 0 !important; + padding: 20px 24px !important; + + .modal-title { + color: white; + font-weight: 600; + font-size: 20px; + margin: 0; + } + + .close { + color: white; + opacity: 0.8; + + &:hover { + opacity: 1; + } + } +} + +// Modal Body +::ng-deep .modal-body { + padding: 24px !important; +} + +// Modal Footer +::ng-deep .modal-footer { + padding: 20px 24px !important; + background: var(--theme-background); + border-radius: 0 0 16px 16px !important; + border-top: 1px solid rgba(0, 0, 0, 0.05) !important; +} + +// Responsive adjustments +@media (max-width: 768px) { + .ug-hero { + flex-direction: column; + gap: 16px; + text-align: center; + + &__content { + flex-direction: column; + text-align: center; + } + + &__actions { + width: 100%; + justify-content: center; + flex-wrap: wrap; + } + } + + .ug-toolbar { + flex-direction: column; + gap: 16px; + } + + .ug-search { + max-width: 100%; + } + + .ug-cards { + grid-template-columns: 1fr; + } + + .ug-card-item { + &__header { + flex-direction: column; + text-align: center; + + &__icon { + margin-right: 0; + margin-bottom: 16px; + } + } + + &__footer { + justify-content: center; + } + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.spec.ts new file mode 100644 index 0000000..945eb38 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UsergrpmaintenanceComponent } from './usergrpmaintenance.component'; + +describe('UsergrpmaintenanceComponent', () => { + let component: UsergrpmaintenanceComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ UsergrpmaintenanceComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(UsergrpmaintenanceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.ts new file mode 100644 index 0000000..5b62fad --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usergrpmaintenance/usergrpmaintenance.component.ts @@ -0,0 +1,246 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ExcelService } from '../../../../services/excel.service'; +import * as moment from 'moment'; +import { UsergrpmaintainceService } from '../../../../services/admin/usergrpmaintaince.service'; +import { ToastrService } from 'ngx-toastr'; +import { MenuGroupService } from 'src/app/services/admin/menu-group.service'; +import { CsvService } from 'src/app/services/csv.service'; +import { TranslateService } from '@ngx-translate/core'; +import { ThemeService } from 'src/app/services/theme.service'; +import { Subscription } from 'rxjs'; + +@Component({ + selector: 'app-usergrpmaintenance', + templateUrl: './usergrpmaintenance.component.html', + styleUrls: ['./usergrpmaintenance.component.scss'] +}) +export class UsergrpmaintenanceComponent implements OnInit, OnDestroy { + loading = false; + public entryForm: FormGroup; + givendata; + orders; + error; + modalAdd= false; + modaledit=false; + modaldelete=false; + rowSelected :any= {}; + mcreate: string | boolean = false; + medit: string | boolean = false; + showdata: any; + submitted=false; + filterText: string = ''; + viewMode: 'table' | 'cards' = 'cards'; + private themeSubscription: Subscription; + + constructor( + private excel: ExcelService, + private toastr:ToastrService, + private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private menuGroupService: MenuGroupService, + private mainservice:UsergrpmaintainceService, + private csvService: CsvService, + private translate: TranslateService, + private themeService: ThemeService, + ) { } + + switchLanguage(language: string) { + this.translate.use(language); + } + + ngOnInit(): void { + this.themeSubscription = this.themeService.currentTheme$.subscribe(() => { + // Theme changes will automatically update CSS variables + // This triggers a re-render of themed elements + }); + + this.showdata = this.menuGroupService.getdata(); + console.log('Showdata:', this.showdata); + if (this.showdata) { + // Handle both string and boolean values + this.mcreate = this.showdata.mcreate === 'true' || this.showdata.mcreate === true ? true : false; + this.medit = this.showdata.medit === 'true' || this.showdata.medit === true ? true : false; + console.log('MCREATE:', this.mcreate); + console.log('MEDIT:', this.medit); + } + + this.mainservice.getAll().subscribe((data) => { + console.log('Data received:', data); + this.givendata = data || []; + if(this.givendata.length==0){ + this.error="No data Available"; + console.log(this.error) + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + + this.entryForm = this._fb.group({ + groupName:['',[Validators.required]] , + groupDesc:['',[Validators.required]] , + groupLevel:['',[Validators.required]] , + status:['',[Validators.required]] , + + }); + } + + ngOnDestroy(): void { + if (this.themeSubscription) { + this.themeSubscription.unsubscribe(); + } + } + + get totalGroups(): number { + const list: any[] = (this.givendata as unknown as any[]) || []; + return list.length; + } + + + get filteredGroups(): any[] { + const items: any[] = (this.givendata as unknown as any[]) || []; + const text = (this.filterText || '').toLowerCase(); + if (!text) { return items; } + return items.filter(g => ( + (g?.groupName || '').toLowerCase().includes(text) || + (g?.groupDesc || '').toLowerCase().includes(text) + )); + } + + setViewMode(mode: 'table' | 'cards') { this.viewMode = mode; } + onExport() { + this.excel.exportAsExcelFile(this.givendata, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + goToAdd() { + this.modalAdd=true; + //this.router.navigate(["../usermaintanceadd"],{relativeTo:this.route}); + } + goToEdit(row){ + console.log('Edit clicked for row:', row); + this.rowSelected = {...row}; // Create a copy to avoid reference issues + this.modaledit=true; + //this.router.navigate(["../usermaintanceedit/"+ id], { relativeTo: this.route }); + } + onUpdate(id) { + this.modaledit = false; + //console.log("in update"); + console.log("id "+id); + console.log( this.rowSelected ); + //console.log("out update"); + this.mainservice.update(this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data) { + this.toastr.success('Updated successfully'); + } + }, (error) => { + console.log(error); + if(error){ + this.toastr.error('Not Updated Data Getting Some Error'); + } + } + ); + } + onSubmit() { + console.log(this.entryForm.value); + this.submitted=true; + if (this.entryForm.invalid) { + return; + } + this.onCreate(); + } + onCreate() { + this.modalAdd=false; + this.mainservice.create(this.entryForm.value).subscribe(data => { + console.log(data) + this.ngOnInit(); + if (data) { + this.toastr.success('Added successfully'); + } + }, + (error) => { + console.log(error); + if(error){ + this.toastr.error('Not Added Data Getting Some Error'); + } + } + ); + // if (this.entryForm.value) { + // this.toastr.success('Added successfully'); + + // } + } + onDelete(row) { + console.log('Delete clicked for row:', row); + this.rowSelected = {...row}; // Create a copy to avoid reference issues + this.modaldelete=true; + } + + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainservice.deleteusr(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { + this.toastr.success('Deleted successfully'); + } + }, + (error) => { + console.log('Error in adding data...',+error); + if(error){ + this.toastr.error('Not Deleted Data Getting Some Error'); + } + } + ); + + + } + + + + // csv + + modalCsv = false; + selectedFiles: File; + fileList; + ttype = 'usergroupmaintenance'; + + + // Import CSV + public selectFile(event) { + this.selectedFiles = event.target.files[0]; + // this.saveCsv(); + } + + csvImport() { + console.log("import CSV"); + this.modalCsv = true; + } + saveCsv() { + this.csvService.importCsv(this.selectedFiles, this.ttype).subscribe(data => { + console.log(data); + this.fileList = data; + this.modalCsv = false; + }, + (error) => { + console.log(error); + if (error.status == 202) { + this.toastr.success(error.error.text) + } + }); + } + + downloadFiles() { + this.csvService.downloadCsvs(this.ttype); + + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.html new file mode 100644 index 0000000..88e73f5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.html @@ -0,0 +1,202 @@ + + +
+
+
+
+

{{'USER_MAINTENANCE'| translate}}

+

{{ 'SECURITY' | translate }}

+
+
+
+ + + + + +
+
+ +
+
+ +
+
+
+ + +
+
+
+ + + + + {{'LOADING' | translate}} ... + +
{{error}}
+
+ + + + {{'USER_ID' | translate}} + + + + + {{'FULL_NAME' | translate}} + + + + + {{'EMAIL' | translate}} + + + + + {{'USER_GROUP_NAME' | translate}} + + + + + {{user.userId}} + {{user.fullName}} + {{user.email}} + {{user.usrGrpName}} + + + + + + + + + + + + + +
username{{user.username}}
+
+
+ + + + Record per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} Records + + +
+ +
+
+
+
+
{{user.fullName}}
+
ID: {{user.userId}}
+
+
+
{{'EMAIL' | translate}}{{user.email}}
+
{{'GROUP' | translate}}{{user.usrGrpName}}
+
+ +
+
+ + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.scss new file mode 100644 index 0000000..adab424 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.scss @@ -0,0 +1,656 @@ +@import '../../../../../styles.scss'; + +// Import design tokens +@import '../../../../../styles/design-tokens'; + +.delete, .heading { + text-align: center; + color: red; +} + +// Modern User Maintenance Styles +.um-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + font-family: var(--theme-font-primary); + + &__content { + display: flex; + align-items: center; + gap: 16px; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 16px; + display: flex; + align-items: center; + justify-content: center; + + clr-icon { + width: 36px; + height: 36px; + color: white; + } + } + + &__title { + font-size: 28px; + font-weight: 700; + margin: 0; + color: white; + font-family: var(--theme-font-secondary); + } + + &__subtitle { + font-size: 16px; + margin: 0; + opacity: 0.9; + color: rgba(255, 255, 255, 0.8); + } + + &__actions { + display: flex; + gap: 12px; + } +} + +.um-btn-text { + margin-left: 8px; +} + +// Modern Button Styles using ThemeService +.um-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + font-size: 14px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; + + &:focus { + outline: 2px solid var(--theme-primary); + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + // Sizes + &.um-btn-sm { + padding: 8px 16px; + font-size: 13px; + height: 32px; + } + + &.um-btn-md { + padding: 12px 20px; + font-size: 14px; + height: 40px; + } + + &.um-btn-lg { + padding: 16px 24px; + font-size: 16px; + height: 48px; + } + + // Variants + &.um-btn-primary { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-color: var(--theme-primary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: linear-gradient(135deg, var(--theme-primary, #0284c7) 0%, var(--theme-accent, #7c3aed) 100%); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + + &:active { + transform: translateY(0); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + } + + &.um-btn-secondary { + background: var(--theme-surface); + color: var(--theme-text); + border-color: rgba(0, 0, 0, 0.1); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-background); + border-color: rgba(0, 0, 0, 0.2); + transform: translateY(-1px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.um-btn-outline { + background: transparent; + color: var(--theme-secondary); + border-color: var(--theme-secondary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: rgba(100, 116, 139, 0.1); // var(--theme-secondary) with 10% opacity + border-color: var(--theme-secondary); + color: var(--theme-secondary); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.um-btn-error { + background: var(--theme-error, #ef4444); + color: white; + border-color: var(--theme-error, #ef4444); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.1); + } + } + + &.um-btn-ghost { + background: transparent; + color: var(--theme-text-secondary); + border-color: transparent; + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } + } +} + +.um-toolbar { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + padding: 16px; + background: var(--theme-surface); + border-radius: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &__left { + flex: 1; + } + + &__right { + display: flex; + gap: 8px; + } +} + +.um-search { + position: relative; + max-width: 400px; + + clr-icon { + position: absolute; + left: 12px; + top: 50%; + transform: translateY(-50%); + color: #9ca3af; + z-index: 1; + } + + &__input { + width: 100%; + padding: 12px 12px 12px 40px; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + font-size: 14px; + transition: all 200ms ease-out; + background: var(--theme-surface); + color: var(--theme-text); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); // var(--theme-primary) with 10% opacity + } + } +} + +.um-view-toggle { + display: flex; + border: 1px solid #d1d5db; + border-radius: 8px; + overflow: hidden; + + .um-btn { + border-radius: 0; + border: none; + background: var(--theme-surface); + color: var(--theme-text-secondary); + + &:first-child { + border-right: 1px solid #d1d5db; + } + + &.um-btn-primary { + background: var(--theme-primary); + color: white; + } + } +} + +// Modern Table Styles +.um-grid { + background: var(--theme-surface); + border-radius: 16px; + overflow: hidden; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + + ::ng-deep .datagrid { + .datagrid-head { + background: var(--theme-background); + + .datagrid-column { + padding: 16px 24px; + font-size: 12px; + font-weight: 600; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid #e5e7eb; + } + } + + .datagrid-row { + transition: background-color 150ms ease-out; + + &:hover { + background: var(--theme-background); + } + + &:not(:last-child) { + border-bottom: 1px solid #e5e7eb; + } + + .datagrid-cell { + padding: 16px 24px; + font-size: 14px; + color: var(--theme-text); + } + } + + .datagrid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; + padding: 16px 24px; + } + } +} + +.um-grid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; +} + +// Modern Card Styles - More beautiful design +.um-cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); + gap: 24px; + margin-bottom: 24px; +} + +.um-card-item { + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.06); + border-radius: var(--theme-border-radius); // Using theme variable + box-shadow: var(--theme-shadow); // Using theme variable + overflow: hidden; + display: flex; + flex-direction: column; + transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); + + &:hover { + transform: translateY(-5px); + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); + border-color: rgba(14, 165, 233, 0.3); // var(--theme-primary) with 30% opacity + } + + &__header { + display: flex; + align-items: center; + gap: 10px; + padding: 16px; + background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), transparent); // var(--theme-primary) with 10% opacity + min-height: 60px; + } + + &__icon { + clr-icon { + width: 24px; + height: 24px; + color: var(--theme-primary); + } + } + + &__title { + font-weight: 700; + flex: 1 1 auto; + font-size: 18px; + color: var(--theme-text); + max-width: 60%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + &__badge { + margin-left: auto; + display: inline-flex; + align-items: center; + padding: 4px 12px; + font-size: 12px; + font-weight: 600; + border-radius: 9999px; + text-transform: uppercase; + letter-spacing: 0.05em; + background: linear-gradient(135deg, rgba(100, 116, 139, 0.1) 0%, rgba(100, 116, 139, 0.05) 100%); + color: var(--theme-secondary); + } + + &__body { + padding: 16px; + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px; + } + + &__footer { + padding: 16px; + display: flex; + gap: 8px; + border-top: 1px solid rgba(0, 0, 0, 0.06); + background: var(--theme-background); + } +} + +.um-kv { + display: flex; + justify-content: space-between; + font-size: 14px; + + span { + color: var(--theme-text-secondary); + } + + strong { + color: var(--theme-text); + font-weight: 500; + text-align: right; + max-width: 60%; + overflow: hidden; + text-overflow: ellipsis; + } +} + +// Theme the card footer buttons +.um-card-item__footer .um-btn { + border-radius: 10px; + flex: 1; + justify-content: center; +} + +.um-card-item__footer .um-btn.um-btn-outline { + border: 1px solid var(--theme-secondary); + color: var(--theme-secondary); + background: transparent; +} + +.um-card-item__footer .um-btn.um-btn-outline:hover { + background: rgba(0, 0, 0, 0.04); +} + +.um-card-item__footer .um-btn.um-btn-error { + background: var(--theme-error, #ef4444); + color: #fff; +} + +.um-card-item__footer .um-btn.um-btn-error:hover { + background: var(--theme-error-dark, #dc2626); +} + +// Action items in table +.um-action-item { + @extend .um-btn; + @extend .um-btn-ghost; + @extend .um-btn-sm; + width: 100%; + justify-content: flex-start; + margin-bottom: 4px; + text-align: left; + + clr-icon { + width: 16px; + height: 16px; + margin-right: 8px; + } + + &.um-btn-error { + color: var(--theme-error, #ef4444); + + &:hover { + background: rgba(239, 68, 68, 0.1); + } + } +} + +// Ensure action overflow is visible +::ng-deep .datagrid-action-overflow { + button.action-item { + display: flex; + align-items: center; + width: 100%; + text-align: left; + padding: 8px 12px; + + clr-icon { + margin-right: 8px; + } + } +} + +// Delete Modal Styles +.um-delete-header { + text-align: center; + padding: 24px; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.um-delete-icon { + color: #ef4444; + margin-bottom: 16px; +} + +.um-delete-title { + font-size: 24px; + font-weight: 700; + color: var(--theme-text); + margin: 0 0 8px 0; +} + +.um-delete-subtitle { + font-size: 16px; + color: var(--theme-text-secondary); + margin: 0; +} + +.um-delete-details { + padding: 24px; +} + +.um-delete-detail-item { + display: flex; + justify-content: space-between; + padding: 12px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + + &:last-child { + border-bottom: none; + } +} + +.um-delete-detail-label { + font-weight: 500; + color: var(--theme-text-secondary); +} + +.um-delete-detail-value { + font-weight: 600; + color: var(--theme-text); +} + +// Form Styles +.um-form-group { + margin-bottom: 20px; +} + +.um-form-label { + display: block; + font-size: 14px; + font-weight: 500; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); +} + +.um-file-input { + width: 100%; + padding: 12px; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + background: var(--theme-surface); + color: var(--theme-text); + + &::file-selector-button { + @extend .um-btn; + @extend .um-btn-secondary; + margin-right: 12px; + padding: 8px 16px; + border: none; + } +} + +// Modal Header +::ng-deep .modal-header { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px 16px 0 0 !important; + padding: 20px 24px !important; + + .modal-title { + color: white; + font-weight: 600; + font-size: 20px; + margin: 0; + } + + .close { + color: white; + opacity: 0.8; + + &:hover { + opacity: 1; + } + } +} + +// Modal Body +::ng-deep .modal-body { + padding: 24px !important; +} + +// Modal Footer +::ng-deep .modal-footer { + padding: 20px 24px !important; + background: var(--theme-background); + border-radius: 0 0 16px 16px !important; + border-top: 1px solid rgba(0, 0, 0, 0.05) !important; +} + +// Responsive adjustments +@media (max-width: 768px) { + .um-hero { + flex-direction: column; + gap: 16px; + text-align: center; + + &__content { + flex-direction: column; + text-align: center; + } + + &__actions { + width: 100%; + justify-content: center; + flex-wrap: wrap; + } + } + + .um-toolbar { + flex-direction: column; + gap: 16px; + } + + .um-search { + max-width: 100%; + } + + .um-cards { + grid-template-columns: 1fr; + } + + .um-card-item { + &__header { + flex-direction: column; + text-align: center; + + &__icon { + margin-right: 0; + margin-bottom: 16px; + } + } + + &__footer { + justify-content: center; + } + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.spec.ts new file mode 100644 index 0000000..881f48f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UsermaintanceComponent } from './usermaintance.component'; + +describe('UsermaintanceComponent', () => { + let component: UsermaintanceComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ UsermaintanceComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(UsermaintanceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.ts new file mode 100644 index 0000000..d801642 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintance/usermaintance.component.ts @@ -0,0 +1,199 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ExcelService } from '../../../../services/excel.service'; +import * as moment from 'moment'; +import { UsermaintanceService } from '../../../../services/admin/usermaintance.service'; +import { MenuGroupService } from 'src/app/services/admin/menu-group.service'; +import { ToastrService } from 'ngx-toastr'; +import { CsvService } from 'src/app/services/csv.service'; +import { TranslateService } from '@ngx-translate/core'; +import { ThemeService } from 'src/app/services/theme.service'; +import { Subscription } from 'rxjs'; + +@Component({ + selector: 'app-usermaintance', + templateUrl: './usermaintance.component.html', + styleUrls: ['./usermaintance.component.scss'] +}) +export class UsermaintanceComponent implements OnInit, OnDestroy { + loading = false; + loading1=false; + public entryForm: FormGroup; + givendata; + orders; + modalAdd= false; + modaledit=false; + mcreate: string | boolean = false; + medit: string | boolean = false; + mdelete; + showdata; + error; + modaldelete=false; + rowSelected :any= {}; + // UI-only state + filterText: string = ''; + viewMode: 'table' | 'cards' = 'cards'; + private themeSubscription: Subscription; + + constructor(private excel: ExcelService, + private _fb: FormBuilder, + private router: Router, private toastr:ToastrService, + private route: ActivatedRoute, + private menuGroupService: MenuGroupService, + private mainservice:UsermaintanceService, + private csvService: CsvService, + private translate: TranslateService, + private themeService: ThemeService, + ) {this.loading1 = true; + setTimeout(() => { + this.loading1 = false; + }, 1000); } + + switchLanguage(language: string) { + this.translate.use(language); + } + + ngOnInit(): void { + this.themeSubscription = this.themeService.currentTheme$.subscribe(() => { + // Theme changes will automatically update CSS variables + // This triggers a re-render of themed elements + }); + + this.showdata = this.menuGroupService.getdata(); + console.log(this.showdata); + if (this.showdata) { + this.mcreate = this.showdata.mcreate === 'true' || this.showdata.mcreate === true ? true : false; + console.log(this.mcreate); + this.mdelete=this.showdata.mdelete + console.log(this.mdelete); + this.medit = this.showdata.medit === 'true' || this.showdata.medit === true ? true : false; + console.log(this.medit); + } + this.getData(); + } + + ngOnDestroy(): void { + if (this.themeSubscription) { + this.themeSubscription.unsubscribe(); + } + } + + getData(){ + this.mainservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + if(this.givendata.length==0){ + this.error="No data Available"; + console.log(this.error) + } + // for(let i =0;i { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + + // UI helpers + get totalUsers(): number { + const list: any[] = (this.givendata as unknown as any[]) || []; + return list.length; + } + get filteredUsers(): any[] { + const items: any[] = (this.givendata as unknown as any[]) || []; + const text = (this.filterText || '').toLowerCase(); + if (!text) { return items; } + return items.filter(u => ( + (u?.fullName || '').toLowerCase().includes(text) || + (u?.email || '').toLowerCase().includes(text) || + (u?.usrGrpName || '').toLowerCase().includes(text) + )); + } + setViewMode(mode: 'table' | 'cards') { this.viewMode = mode; } + + + // csv + + modalCsv = false; + selectedFiles: File; + fileList; + ttype = 'usermaintenance'; + + + // Import CSV + public selectFile(event) { + this.selectedFiles = event.target.files[0]; + // this.saveCsv(); + } + + csvImport() { + console.log("import CSV"); + this.modalCsv = true; + } + saveCsv() { + this.csvService.importCsv(this.selectedFiles, this.ttype).subscribe(data => { + console.log(data); + this.fileList = data; + this.modalCsv = false; + }, + (error) => { + console.log(error); + if (error.status == 202) { + this.toastr.success(error.error.text) + } + }); + } + + downloadFiles() { + this.csvService.downloadCsvs(this.ttype); + + } + + + onExport() { + this.excel.exportAsExcelFile(this.givendata, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + goToAdd() { + this.router.navigate(["../usermaintanceadd"],{relativeTo:this.route}); + } + goToEdit(id: number){ + this.router.navigate(["../usermaintancedit/"+ id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = {...row}; // Create a copy to avoid reference issues + this.modaldelete=true; + } + + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainservice.deleteusr(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { + this.toastr.success('Deleted successfully'); + } + }, + (error) => { + console.log('Error in adding data...',+error); + if(error){ + this.toastr.error('Not Deleted Data Getting Some Error'); + } + } + ); + + + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.html new file mode 100644 index 0000000..d673199 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.html @@ -0,0 +1,282 @@ + + +
+
+
+
+

User Maintenance

+

Add New User

+
+
+
+ +
+
+
+
+
+ + +
+
*This field is Required
+
+
+ +
+ + +
+
*This field is Required
+
+
+ +
+ + +
+
*This field is Required
+
* Please Follow your pattern,+91 Enter 10 digit Mobile Number.
+
+
+ +
+ + +
+
*This field is Required
+
*Email must be a valid email address
+
+
+ +
+ + +
+
*Password is required
+
* Password must be at least 6 characters
+
+
+ +
+ + +
+
* Confirm Password is required
+
* Password and Confirm Password must be match.
+
+
+ +
+ + +
+
*This field is Required
+
+
+ +
+ + +
+
*This field is Required
+
+
+
+ +
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.scss new file mode 100644 index 0000000..e182a11 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.scss @@ -0,0 +1,390 @@ +@import '../../../../../styles1.scss'; +@import '../../../../../styles/_design-tokens.scss'; + +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} + +// User Maintenance Add Styles +.um-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + font-family: var(--theme-font-primary); + + &__content { + display: flex; + align-items: center; + gap: 16px; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 16px; + display: flex; + align-items: center; + justify-content: center; + + clr-icon { + width: 36px; + height: 36px; + color: white; + } + } + + &__title { + font-size: 28px; + font-weight: 700; + margin: 0; + color: white; + font-family: var(--theme-font-secondary); + } + + &__subtitle { + font-size: 16px; + margin: 0; + opacity: 0.9; + color: rgba(255, 255, 255, 0.8); + } +} + +.um-add-container { + background: var(--theme-surface); + border-radius: 16px; + padding: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; +} + +.um-form-card { + background: var(--theme-surface); + border-radius: 12px; + padding: 24px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); +} + +.um-form { + .clr-row { + margin: 0 -12px; + } + + .clr-col-md-6, + .clr-col-sm-12 { + padding: 0 12px; + margin-bottom: 20px; + } +} + +.um-form-label { + display: block; + font-size: 14px; + font-weight: 500; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); +} + +.um-form-input, +.um-form-select { + width: 100%; + padding: 12px 16px; + font-size: 14px; + line-height: 1.5; + color: var(--theme-text); + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + transition: all 200ms ease-out; + margin-bottom: 0; + font-family: var(--theme-font-primary); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); // var(--theme-primary) with 10% opacity + } + + &:disabled { + background: var(--theme-background); + color: var(--theme-text-secondary); + cursor: not-allowed; + } + + &.error { + border-color: #ef4444; + box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); + } + + &::placeholder { + color: var(--theme-text-secondary); + } +} + +.um-form-select { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e"); + background-position: right 12px center; + background-repeat: no-repeat; + background-size: 16px 12px; + padding-right: 40px; + appearance: none; +} + +.um-error-message { + color: #ef4444; + font-size: 12px; + margin-top: 6px; + font-weight: 500; +} + +.required-field { + color: #ef4444; + margin-left: 4px; +} + +.um-form-actions { + display: flex; + gap: 12px; + margin-top: 24px; + padding-top: 24px; + border-top: 1px solid rgba(0, 0, 0, 0.05); +} + +// Modern Button Styles using ThemeService +.um-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + font-size: 14px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; + + &:focus { + outline: 2px solid var(--theme-primary); + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + // Sizes + &.um-btn-sm { + padding: 8px 16px; + font-size: 13px; + height: 32px; + } + + &.um-btn-md { + padding: 12px 20px; + font-size: 14px; + height: 40px; + } + + &.um-btn-lg { + padding: 16px 24px; + font-size: 16px; + height: 48px; + } + + // Variants + &.um-btn-primary { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-color: var(--theme-primary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: linear-gradient(135deg, var(--theme-primary, #0284c7) 0%, var(--theme-accent, #7c3aed) 100%); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + + &:active { + transform: translateY(0); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + } + + &.um-btn-outline { + background: transparent; + color: var(--theme-secondary); + border-color: var(--theme-secondary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: rgba(100, 116, 139, 0.1); // var(--theme-secondary) with 10% opacity + border-color: var(--theme-secondary); + color: var(--theme-secondary); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.um-btn-error { + background: var(--theme-error, #ef4444); + color: white; + border-color: var(--theme-error, #ef4444); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.1); + } + } + + &.um-btn-ghost { + background: transparent; + color: var(--theme-text-secondary); + border-color: transparent; + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } + } +} + +.um-clickable-cell { + color: var(--theme-primary); + cursor: pointer; + transition: all 200ms ease-out; + + &:hover { + text-decoration: underline; + transform: translateY(-1px); + } +} + +// Modal Styles +::ng-deep .modal-header { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px 16px 0 0 !important; + padding: 20px 24px !important; + + .modal-title { + color: white; + font-weight: 600; + font-size: 20px; + margin: 0; + } + + .close { + color: white; + opacity: 0.8; + + &:hover { + opacity: 1; + } + } +} + +::ng-deep .modal-body { + padding: 24px !important; +} + +::ng-deep .modal-footer { + padding: 20px 24px !important; + background: var(--theme-background); + border-radius: 0 0 16px 16px !important; + border-top: 1px solid rgba(0, 0, 0, 0.05) !important; +} + +// Data Grid Styles +.um-datagrid { + background: var(--theme-surface); + border-radius: 16px; + overflow: hidden; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + + ::ng-deep .datagrid { + .datagrid-head { + background: var(--theme-background); + + .datagrid-column { + padding: 16px 24px; + font-size: 12px; + font-weight: 600; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid #e5e7eb; + } + } + + .datagrid-row { + transition: background-color 150ms ease-out; + + &:hover { + background: var(--theme-background); + } + + &:not(:last-child) { + border-bottom: 1px solid #e5e7eb; + } + + .datagrid-cell { + padding: 16px 24px; + font-size: 14px; + color: var(--theme-text); + } + } + + .datagrid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; + padding: 16px 24px; + } + } +} + +// Responsive adjustments +@media (max-width: 768px) { + .um-hero { + flex-direction: column; + gap: 16px; + text-align: center; + + &__content { + flex-direction: column; + text-align: center; + } + } + + .um-form-actions { + flex-direction: column; + } + + .um-btn { + width: 100%; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.spec.ts new file mode 100644 index 0000000..3a520a3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UsermaintanceaddComponent } from './usermaintanceadd.component'; + +describe('UsermaintanceaddComponent', () => { + let component: UsermaintanceaddComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ UsermaintanceaddComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(UsermaintanceaddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.ts new file mode 100644 index 0000000..d1f3388 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceadd/usermaintanceadd.component.ts @@ -0,0 +1,220 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; +import { UsergrpmaintainceService } from 'src/app/services/admin/usergrpmaintaince.service'; +import { UsermaintanceService } from '../../../../services/admin/usermaintance.service'; +import { TranslateService } from '@ngx-translate/core'; +import { ThemeService } from 'src/app/services/theme.service'; +import { Subscription } from 'rxjs'; + +@Component({ + selector: 'app-usermaintanceadd', + templateUrl: './usermaintanceadd.component.html', + styleUrls: ['./usermaintanceadd.component.scss'] +}) +export class UsermaintanceaddComponent implements OnInit { + public entryForm: FormGroup; + customer: boolean = false; + department: boolean = false; + position: boolean = false; + custdata: any; + loading = false; + clickedID: number; + custiddata: any; + userobjcust = { + customerName: '', + customerCode: '', + } + departmentdata: any; + positiondata: any; + deptiddata: any; + userobjdept = { + departmentCode: '', + } + userobjpos = { + positionCode: '', + } + posiddata: any; + usergrpdata; + accessdata; + error; + submitted = false; + private themeSubscription: Subscription; + + constructor(private _fb: FormBuilder, + private mainservice: UsermaintanceService, + private router: Router, private accesstype: AccesstypeService, + private route: ActivatedRoute, + private usergrpservice: UsergrpmaintainceService, + private translate: TranslateService, + private themeService: ThemeService, + ) { } + + switchLanguage(language: string) { + this.translate.use(language); + } + + ngOnInit(): void { + this.themeSubscription = this.themeService.currentTheme$.subscribe(() => { + // Theme changes will automatically update CSS variables + // This triggers a re-render of themed elements + }); + + this.entryForm = this._fb.group({ + first_name: ['', [Validators.required]], + last_name: ['', [Validators.required]], + email: ['', [Validators.required, Validators.email]], + mob_no: ['', [Validators.required]], + new_password: ['', [Validators.required, Validators.minLength(6)]], + confirm_password: ['', [Validators.required]], + usrGrpId: ['', [Validators.required]], + account_id: 1, + accesstype: ['', [Validators.required]], + // status:[null], + // username:[null] , + // userPassw:[null] , + // confirmPassword:[null], + // title:[null], + // shortName:[null], + // fullName:[null], + // status:[null], + // positionCodeString:[null], + // departmentCodeString:[null], + // usrGrpId:[null], + // customerId:[null], + // email:[null], + // notification:[null], + + //departmentCode: this._fb.array([this.department()]), + // positionCode: this._fb.array([this.position()]), + //usrGrp: this._fb.array([this.user()]), + + }, { + validator: ConfirmedValidator('new_password', 'confirm_password') + }); + this.usergrp(); + this.getdata(); + } + + ngOnDestroy(): void { + if (this.themeSubscription) { + this.themeSubscription.unsubscribe(); + } + } + + getdata() { + this.accesstype.getAll().subscribe(resp => { + this.accessdata = resp; + console.log('accessdata: ', this.accessdata); + if (this.accessdata.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) + } + usergrp() { + this.usergrpservice.getAll().subscribe((data) => { + console.log(data); + this.usergrpdata = data; + }); + } + // department(){ + // return this._fb.group({ + // departmentCode:[null] , + + // }); + // } + // position(){ + // return this._fb.group({ + // positionCode:[null] , + + // }); + // } + // user(){ + // return this._fb.group({ + // usrGrp:[null] , + + // }); + //} + onSubmit() { + this.submitted = true + if (this.entryForm.invalid) { + return; + } + console.log(this.entryForm.value); + this.mainservice.create(this.entryForm.value).subscribe(data => { + console.log(data) + }, + (error) => { + console.log(error); + } + ); + this.router.navigate(["../usermaintance"], { relativeTo: this.route }); + } + + goback() { + this.router.navigate(["../usermaintance"], { relativeTo: this.route }); + } + gotodepartmet() { + this.department = !this.department; + this.mainservice.getalldepartment().subscribe((data) => { + console.log(data); + this.departmentdata = data; + }); + } + getdepid(id: number) { + this.clickedID = id; + console.log("clicked by id" + id); + this.mainservice.getbydepartmentid(id).subscribe((data) => { + console.log(data); + this.deptiddata = data; + // this.userObj= this.custiddata; + this.userobjdept = this.deptiddata; + + + }); + this.department = false; + } + gotoposition() { + this.position = !this.position; + this.mainservice.getallposition().subscribe((data) => { + console.log(data); + this.positiondata = data; + }) + } + getposid(id: number) { + this.clickedID = id; + console.log("clicked by id" + id); + this.mainservice.getbypositionid(id).subscribe((data) => { + console.log(data); + this.posiddata = data; + // this.userObj= this.custiddata; + this.userobjpos = this.posiddata; + + + }); + this.position = false; + } + + +} +export function ConfirmedValidator(controlName: string, matchingControlName: string) { + return (formGroup: FormGroup) => { + const control = formGroup.controls[controlName]; + const matchingControl = formGroup.controls[matchingControlName]; + if (matchingControl.errors && !matchingControl.errors.confirmedValidator) { + return; + } + if (control.value !== matchingControl.value) { + matchingControl.setErrors({ confirmedValidator: true }); + } else { + matchingControl.setErrors(null); + } + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.html new file mode 100644 index 0000000..e2721fe --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.html @@ -0,0 +1,249 @@ + + +
+
+
+
+

User Maintenance

+

Edit User

+
+
+
+ +
+
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.scss b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.scss new file mode 100644 index 0000000..66585f8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.scss @@ -0,0 +1,375 @@ +@import '../../../../../styles1.scss'; +@import '../../../../../styles/_design-tokens.scss'; + +// User Maintenance Edit Styles +.um-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + font-family: var(--theme-font-primary); + + &__content { + display: flex; + align-items: center; + gap: 16px; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 16px; + display: flex; + align-items: center; + justify-content: center; + + clr-icon { + width: 36px; + height: 36px; + color: white; + } + } + + &__title { + font-size: 28px; + font-weight: 700; + margin: 0; + color: white; + font-family: var(--theme-font-secondary); + } + + &__subtitle { + font-size: 16px; + margin: 0; + opacity: 0.9; + color: rgba(255, 255, 255, 0.8); + } +} + +.um-edit-container { + background: var(--theme-surface); + border-radius: 16px; + padding: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; +} + +.um-form-card { + background: var(--theme-surface); + border-radius: 12px; + padding: 24px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); +} + +.um-form { + .clr-row { + margin: 0 -12px; + } + + .clr-col-md-6, + .clr-col-sm-12 { + padding: 0 12px; + margin-bottom: 20px; + } +} + +.um-form-label { + display: block; + font-size: 14px; + font-weight: 500; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); +} + +.um-form-input, +.um-form-select { + width: 100%; + padding: 12px 16px; + font-size: 14px; + line-height: 1.5; + color: var(--theme-text); + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + transition: all 200ms ease-out; + margin-bottom: 0; + font-family: var(--theme-font-primary); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); // var(--theme-primary) with 10% opacity + } + + &:disabled { + background: var(--theme-background); + color: var(--theme-text-secondary); + cursor: not-allowed; + } + + &.error { + border-color: #ef4444; + box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); + } + + &::placeholder { + color: var(--theme-text-secondary); + } +} + +.um-form-select { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e"); + background-position: right 12px center; + background-repeat: no-repeat; + background-size: 16px 12px; + padding-right: 40px; + appearance: none; +} + +.required-field { + color: #ef4444; + margin-left: 4px; +} + +.um-form-actions { + display: flex; + gap: 12px; + margin-top: 24px; + padding-top: 24px; + border-top: 1px solid rgba(0, 0, 0, 0.05); +} + +// Modern Button Styles using ThemeService +.um-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + font-size: 14px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; + + &:focus { + outline: 2px solid var(--theme-primary); + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + // Sizes + &.um-btn-sm { + padding: 8px 16px; + font-size: 13px; + height: 32px; + } + + &.um-btn-md { + padding: 12px 20px; + font-size: 14px; + height: 40px; + } + + &.um-btn-lg { + padding: 16px 24px; + font-size: 16px; + height: 48px; + } + + // Variants + &.um-btn-primary { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-color: var(--theme-primary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: linear-gradient(135deg, var(--theme-primary, #0284c7) 0%, var(--theme-accent, #7c3aed) 100%); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + + &:active { + transform: translateY(0); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + } + + &.um-btn-outline { + background: transparent; + color: var(--theme-secondary); + border-color: var(--theme-secondary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: rgba(100, 116, 139, 0.1); // var(--theme-secondary) with 10% opacity + border-color: var(--theme-secondary); + color: var(--theme-secondary); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.um-btn-error { + background: var(--theme-error, #ef4444); + color: white; + border-color: var(--theme-error, #ef4444); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.1); + } + } + + &.um-btn-ghost { + background: transparent; + color: var(--theme-text-secondary); + border-color: transparent; + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } + } +} + +.um-clickable-cell { + color: var(--theme-primary); + cursor: pointer; + transition: all 200ms ease-out; + + &:hover { + text-decoration: underline; + transform: translateY(-1px); + } +} + +// Modal Styles +::ng-deep .modal-header { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px 16px 0 0 !important; + padding: 20px 24px !important; + + .modal-title { + color: white; + font-weight: 600; + font-size: 20px; + margin: 0; + } + + .close { + color: white; + opacity: 0.8; + + &:hover { + opacity: 1; + } + } +} + +::ng-deep .modal-body { + padding: 24px !important; +} + +::ng-deep .modal-footer { + padding: 20px 24px !important; + background: var(--theme-background); + border-radius: 0 0 16px 16px !important; + border-top: 1px solid rgba(0, 0, 0, 0.05) !important; +} + +// Data Grid Styles +.um-datagrid { + background: var(--theme-surface); + border-radius: 16px; + overflow: hidden; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + + ::ng-deep .datagrid { + .datagrid-head { + background: var(--theme-background); + + .datagrid-column { + padding: 16px 24px; + font-size: 12px; + font-weight: 600; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid #e5e7eb; + } + } + + .datagrid-row { + transition: background-color 150ms ease-out; + + &:hover { + background: var(--theme-background); + } + + &:not(:last-child) { + border-bottom: 1px solid #e5e7eb; + } + + .datagrid-cell { + padding: 16px 24px; + font-size: 14px; + color: var(--theme-text); + } + } + + .datagrid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; + padding: 16px 24px; + } + } +} + +// Responsive adjustments +@media (max-width: 768px) { + .um-hero { + flex-direction: column; + gap: 16px; + text-align: center; + + &__content { + flex-direction: column; + text-align: center; + } + } + + .um-form-actions { + flex-direction: column; + } + + .um-btn { + width: 100%; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.spec.ts new file mode 100644 index 0000000..4173d29 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UsermaintanceeditComponent } from './usermaintanceedit.component'; + +describe('UsermaintanceeditComponent', () => { + let component: UsermaintanceeditComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ UsermaintanceeditComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(UsermaintanceeditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.ts new file mode 100644 index 0000000..533fc95 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/usermaintanceedit/usermaintanceedit.component.ts @@ -0,0 +1,154 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; +import { UsergrpmaintainceService } from 'src/app/services/admin/usergrpmaintaince.service'; +import { UsermaintanceService } from '../../../../services/admin/usermaintance.service'; +import { TranslateService } from '@ngx-translate/core'; +import { ThemeService } from 'src/app/services/theme.service'; +import { Subscription } from 'rxjs'; + +@Component({ + selector: 'app-usermaintanceedit', + templateUrl: './usermaintanceedit.component.html', + styleUrls: ['./usermaintanceedit.component.scss'] +}) +export class UsermaintanceeditComponent implements OnInit { + id: number; + data1: any = {}; + customer: boolean = false; + custdata: any; + clickedID: number; + custiddata: any; + loading = false; + userobjcust = { + customerName: '', + customerCode: '', + } + accessdata; + department: boolean = false; + departmentdata: any; + positiondata: any; + deptiddata: any; + userobjdept = { + departmentCode: '', + } + userobjpos = { + positionCode: '', + } + posiddata: any; + position: boolean = false; + usergrpdata; + error; + private themeSubscription: Subscription; + + constructor(private route: ActivatedRoute, + private mainservice: UsermaintanceService, + private router: Router, private accesstype: AccesstypeService, + private usergrpservice: UsergrpmaintainceService, + private translate: TranslateService, + private themeService: ThemeService, + ) { } + + switchLanguage(language: string) { + this.translate.use(language); + } + + ngOnInit(): void { + this.themeSubscription = this.themeService.currentTheme$.subscribe(() => { + // Theme changes will automatically update CSS variables + // This triggers a re-render of themed elements + }); + + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + this.getById(this.id); + // + this.usergrp(); + this.getdata(); + } + + ngOnDestroy(): void { + if (this.themeSubscription) { + this.themeSubscription.unsubscribe(); + } + } + + getdata() { + this.accesstype.getAll().subscribe(resp => { + this.accessdata = resp; + console.log('accessdata: ', this.accessdata); + if (this.accessdata.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) + } + usergrp() { + this.usergrpservice.getAll().subscribe((data) => { + console.log(data); + this.usergrpdata = data; + }); + } + getById(id: number) { + this.mainservice.getbyid(id).subscribe((data) => { + this.data1 = data; + // this.data1=this.data3; + console.log(this.data1); + }); + } + update() { + console.log(this.data1); + this.mainservice.updatenew(this.id, this.data1).subscribe((data) => { + console.log(data); + }); + + } + goback() { + this.router.navigate(["../../usermaintance"], { relativeTo: this.route }); + } + gotodepartmet() { + this.department = !this.department; + this.mainservice.getalldepartment().subscribe((data) => { + console.log(data); + this.departmentdata = data; + }); + } + getdepid(id: number) { + this.clickedID = id; + console.log("clicked by id" + id); + this.mainservice.getbydepartmentid(id).subscribe((data) => { + console.log(data); + this.deptiddata = data; + // this.userObj= this.custiddata; + this.userobjdept = this.deptiddata; + + + }); + this.department = false; + } + gotoposition() { + this.position = !this.position; + this.mainservice.getallposition().subscribe((data) => { + console.log(data); + this.positiondata = data; + }) + } + getposid(id: number) { + this.clickedID = id; + console.log("clicked by id" + id); + this.mainservice.getbypositionid(id).subscribe((data) => { + console.log(data); + this.posiddata = data; + // this.userObj= this.custiddata; + this.userobjpos = this.posiddata; + + + }); + this.position = false; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.html new file mode 100644 index 0000000..3a4976e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.html @@ -0,0 +1,40 @@ + +

{{'define_dashboard'| translate}}

+ {{'add_mode'| translate}} +

+ +
+ + + + + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ + +
+ +
+
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.scss new file mode 100644 index 0000000..4a7ff75 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.scss @@ -0,0 +1,81 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=date],textarea { + width: 100%; + padding: 15px 15px; + margin-top: 3px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.spec.ts new file mode 100644 index 0000000..d4993fe --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddnewdashComponent } from './addnewdash.component'; + +describe('AddnewdashComponent', () => { + let component: AddnewdashComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [AddnewdashComponent] + }); + fixture = TestBed.createComponent(AddnewdashComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.ts new file mode 100644 index 0000000..4ab52f6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/addnewdash/addnewdash.component.ts @@ -0,0 +1,125 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { DashboardService } from 'src/app/services/builder/dashboard.service'; + +@Component({ + selector: 'app-addnewdash', + templateUrl: './addnewdash.component.html', + styleUrls: ['./addnewdash.component.scss'] +}) +export class AddnewdashComponent implements OnInit { + public entryForm: FormGroup; + addToDashboard: boolean = false; + submitted = false; + moduleId:any; + tech_stacks=[]; + object_types = ["form", "bi", "report", "api"]; + sub_object_types = [ + "only header", + "only line", + "header line", + "header multiline", + "wrokflow", + "setup", + "std report", + "bi report", + "rest api", + ]; + jsonString:any; + + fieldModels= + { + + "dashboard": [ + { + "cols": 4, + "rows": 5, + "x": 0, + "y": 0, + "name": "Radar Chart", + "component": "Radar Chart" + + } + ] + } + + wfline = { + model: 'this.fieldModels' + } + dashboard: any; + constructor( private _fb:FormBuilder, + private router: Router, + private route: ActivatedRoute, + private dashboardService : DashboardService, + private toastr : ToastrService, + + ) { } + + ngOnInit(): void { + // this.moduleId = this.wireframeService.getModuleId(); + console.log(this.moduleId); + + this.entryForm = this._fb.group({ + dashboard_name : [null], + description: [null], + secuirity_profile : [null], + module_id:[null], + tech_Stack:[null], + object_type:[null], + sub_object_type:[null], + testing:[null], + build:[null], + add_to_home:[true], + + dashbord1_Line: this._fb.array([this.initLinesForm()]), + // dashbord1_Line: this.fieldModels + }); + + + } + initLinesForm() { + return this._fb.group({ + + model:JSON.stringify(this.fieldModels) + }); + } + + onSubmit() { + console.log("In onSubmit method"); + console.log(this.entryForm.value); + if(this.entryForm.invalid) + { + return; + } + this.onCreate() + + } + onBack(){ + this.router.navigate(["../all"],{relativeTo:this.route}); + } + + onCreate() + { + console.log("in oncreate method"); + this.entryForm.value.module_id=this.moduleId; + + console.log(typeof this.fieldModels) + + this.dashboardService.create(this.entryForm.value).subscribe((data)=>{ + console.log(data); + this.router.navigate(["../all"],{relativeTo:this.route}); + }, + (error) => { + console.log(error); + } + ); + if(this.entryForm.value) + { + this.toastr.success('Added successfully'); + } + } + + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.html new file mode 100644 index 0000000..b50c51f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.html @@ -0,0 +1,145 @@ + + +
+ +
+
+
+

{{ 'Dashboard_builder' | translate }}

+
+
+ + + +
+
+ + + {{ 'Loading' | translate }} ...... +
{{error}}
+ + + + {{ 'Go_to' | translate }} + + + + + {{ 'Dashboard_Name' | translate }} + + + + + {{ 'Description' | translate }} + + + + + {{ 'Security_Profile' | translate }} + + + + + {{ 'Add_to_home' | translate }} + + + + + {{ 'Action' | translate }} + + + + {{ 'SET_UP' | translate }} + {{user.dashboard_name}} + {{user.description}} + {{user.secuirity_profile}} + {{user.add_to_home}} + + + + + + + {{ 'Delete' | translate }} + + + + + +
{{ 'Who_Column' | translate }}
+
{{ 'Account_ID' | translate }}: {{ user.accountId }}
+
{{ 'Created_At' | translate }}: {{ user.createdAt | date }}
+
{{ 'Created_By' | translate }}: {{ user.createdBy }}
+
{{ 'Updated_At' | translate }}: {{ user.updatedAt | date }}
+
{{ 'Updated_By' | translate }}: {{ user.updatedBy }}
+
+
+ +
+ + + + +
+ + + + {{ 'Users_per_page' | translate }} + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + {{ 'of' | translate }} {{pagination.totalItems}} {{ 'users' | translate }} + + +
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.scss new file mode 100644 index 0000000..140a8d4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.scss @@ -0,0 +1,83 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; + } + .td-content{ + text-align: left; + } + .delete,.heading{ + text-align: center; + color: red; + } + input[type='radio']{ + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; + } + .dots + { + width: 100px; + height:100px; + border: 1px solid; + border-radius: 50%; + //background-color: #f00; + } + h4{margin-top: 16px;} + .s-order-dash-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + } + } + #word1{ + width: 190px; + height: 180px; + + } + .center{ + text-align: center; + margin-top: 5px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + .heading{ + text-align: center; + color: red; + } + + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.spec.ts new file mode 100644 index 0000000..9e5246b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AllnewdashComponent } from './allnewdash.component'; + +describe('AllnewdashComponent', () => { + let component: AllnewdashComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [AllnewdashComponent] + }); + fixture = TestBed.createComponent(AllnewdashComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.ts new file mode 100644 index 0000000..b907dae --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/allnewdash/allnewdash.component.ts @@ -0,0 +1,124 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +// import { WireframeService } from 'src/app/services/builder/wireframe.service'; +import { ExcelService } from 'src/app/services/excel.service'; +import * as moment from 'moment'; +import { ModulesetupService } from 'src/app/services/builder/modulesetup.service'; +import { DashboardService } from 'src/app/services/builder/dashboard.service'; +@Component({ + selector: 'app-allnewdash', + templateUrl: './allnewdash.component.html', + styleUrls: ['./allnewdash.component.scss'] +}) +export class AllnewdashComponent implements OnInit { + addModall:boolean = false; + selected:any[] = []; + loading = false; + data:any; + id:any; + moduleId:any; + modalDelete = false; + rowSelected :any= {}; + rows: any[]; + projectname; + projectId; + error; + constructor( + private router : Router, + private route: ActivatedRoute,private dashboardService : DashboardService, + // private wireframeservice : WireframeService, + private excel: ExcelService,private mainService: ModulesetupService, + private toastr: ToastrService,) { } + + ngOnInit(): void { + // this.projectId=this.wireframeservice.getProjectId(); + console.log(this.projectId); + this.id = this.route.snapshot.params["id"]; // fb_header_id + // this.moduleId = this.wireframeservice.getModuleId(); // get from session storage + console.log(this.moduleId); + + this.getdashboard(); + // this.getprojectName(this.projectId); + } + + getprojectName(id){ + this.mainService.getProjectModules(id).subscribe((data) => { + console.log(data); + this.projectname=data.items[0]['projectName']; + console.log(this.projectname); + }); + } + + + getdashboard() + { + this.dashboardService.getAllDash().subscribe((data) =>{ + this.data = data; + this.rows = this.data; + console.log(data); + this.error="No data Available"; + console.log(this.error); + }); + } + + openModal() + { + this.addModall = true; + } + gotoadd() + { + this.router.navigate(['../adddata'],{relativeTo:this.route}); + } + goToEdit(id:number) + { + this.router.navigate(['../editdashn/'+id],{relativeTo:this.route}); + } + + goToEditData(id: number){ + this.router.navigate(['../editdata/'+id],{relativeTo:this.route}); + } + + onExport() { + this.excel.exportAsExcelFile(this.rows, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + + gotoAction(){ + this.router.navigate(["../../actions"], { relativeTo: this.route, queryParams: { m_id: this.moduleId,pname:this.projectname } }); + } + gotoRepo(){ + this.router.navigate(["../../modulecard"], { relativeTo: this.route, queryParams: { p_id: this.projectId } }); + } + + onDelete(row){ + this.rowSelected = row; + console.log(this.rowSelected); + this.modalDelete = true; + } + delete(id) + { + this.modalDelete = false; + console.log("in delete "+id); + this.dashboardService.deleteField(id).subscribe((data)=>{ + console.log(data); + this.ngOnInit(); + }); + if (id) { + this.toastr.success('Deleted successfully'); + } + } + // openModal() + // { + // this.addModall = true; + // } + gotorunner() + { + this.router.navigate(['../../dashboardrunner'],{relativeTo:this.route}); + } + // goToEdit() + // { + // this.router.navigate(['../editdashn'],{relativeTo:this.route}); + // } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.spec.ts new file mode 100644 index 0000000..c7c3d2e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardnewComponent } from './dashboardnew.component'; + +describe('DashboardnewComponent', () => { + let component: DashboardnewComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [DashboardnewComponent] + }); + fixture = TestBed.createComponent(DashboardnewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.ts new file mode 100644 index 0000000..3078dd2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/dashboardnew.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-dashboardnew', + templateUrl: './dashboardnew.component.html', + styleUrls: ['./dashboardnew.component.scss'] +}) +export class DashboardnewComponent { + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.html new file mode 100644 index 0000000..530e940 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.html @@ -0,0 +1,54 @@ +

Dashboard

+Edit Mode +

+ +
+ + + + + + +
+
+
+ + +
+
+ + +
+ + +
+ + +
+
+ + +
+
+
+ +
+ + +
+ +
+
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.scss new file mode 100644 index 0000000..4a7ff75 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.scss @@ -0,0 +1,81 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=date],textarea { + width: 100%; + padding: 15px 15px; + margin-top: 3px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.spec.ts new file mode 100644 index 0000000..9872c96 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditformnewdashComponent } from './editformnewdash.component'; + +describe('EditformnewdashComponent', () => { + let component: EditformnewdashComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [EditformnewdashComponent] + }); + fixture = TestBed.createComponent(EditformnewdashComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.ts new file mode 100644 index 0000000..6e46676 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editformnewdash/editformnewdash.component.ts @@ -0,0 +1,93 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { DashboardService } from 'src/app/services/builder/dashboard.service'; +// import { TechnologyStackService } from 'src/app/services/builder/technology-stack.service'; +// import { WireframeService } from 'src/app/services/builder/wireframe.service'; + +@Component({ + selector: 'app-editformnewdash', + templateUrl: './editformnewdash.component.html', + styleUrls: ['./editformnewdash.component.scss'] +}) +export class EditformnewdashComponent implements OnInit { + updated = false; + Header; + id: number; + moduleId; + tech_stacks=[]; + object_types = ["form", "bi", "report", "api"]; + sub_object_types = [ + "only header", + "only line", + "header line", + "header multiline", + "wrokflow", + "setup", + "std report", + "bi report", + "rest api", + ]; + constructor(private router: Router, + private route: ActivatedRoute, private dashboardService : DashboardService, + // private technologyStackService:TechnologyStackService, + private toastr: ToastrService, + // private wireframeService :WireframeService, + ) { } + + ngOnInit(): void { + // this.moduleId = this.wireframeService.getModuleId(); + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + this.getById(this.id); + // this.technologyStackService.getAll().subscribe((data)=>{ + // console.log(data) + // this.tech_stacks=data; + // }); + } + + getById(id: number) { + this.dashboardService.getById(id).subscribe( + (data) => { + console.log(data); + this.Header = data; + }, + (err) => { + console.log(err); + } + ); + } + update() { + this.dashboardService.updateDash(this.Header).subscribe( + (data) => { + console.log(data); + if (data) { + this.toastr.success('Update successfully'); + } + this.router.navigate(["../../all"], { relativeTo: this.route }); + //this.router.navigate(["../../all"],{ relativeTo: this.route, queryParams: { p_id: this.projectId } }); + }, + (error) => { + // console.log(error); + // const objectArray = Object.entries(error.error.fieldErrors); + // objectArray.forEach(([k, v]) => { + // console.log(k); + // console.log(v); + // this.fieldErors.push({ field: k, message: v }); + // }); + console.log(error); // this will come from backend + } + ); + // this.lineBuilder_Header = new Rn_Cff_ActionBuilder_Header(); + } + + onSubmit() { + this.updated = true; + this.update(); + } + + onBack() { + this.router.navigate(["../../all"], { relativeTo: this.route }); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.html new file mode 100644 index 0000000..02dce20 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.html @@ -0,0 +1,198 @@ + + +
+ +
+ {{dashboardName}} +
+
+ +
+ +
+ +
+ +
+ + + + + + + + + + + +

{{item.name}}

+ + +
+
+
+
+
+ + +
+ + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.scss new file mode 100644 index 0000000..2c08e48 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.scss @@ -0,0 +1,51 @@ +.componentbtn{ + color: white; + background-color: #03AC13; + border: none; + } + .content-container { + min-height: 100vh; + height: initial; + } + a:hover { + text-decoration: none; + cursor: pointer; + } + .clr-checkbox{ + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + // padding: 0.75rem 0.75rem; + // margin-top: 3px; + width: 100%; + margin-left: 20px; + margin-bottom: 18px; + } + .clr-input, .clr-dropdown { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + select{ + width: 100%; + padding: 5px 5px; + margin-top: 3px; + border: 1px solid #ccc; + border-radius: 4px; + } + + input[type=text],[type=date],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.spec.ts new file mode 100644 index 0000000..82dc288 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditnewdashComponent } from './editnewdash.component'; + +describe('EditnewdashComponent', () => { + let component: EditnewdashComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [EditnewdashComponent] + }); + fixture = TestBed.createComponent(EditnewdashComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts new file mode 100644 index 0000000..5104759 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts @@ -0,0 +1,617 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { GridsterConfig } from 'angular-gridster2'; +import { ToastrService } from 'ngx-toastr'; +import { DashboardContentModel, DashboardModel, WidgetModel } from '../../../../../models/builder/dashboard'; +import { Dashboard3Service } from '../../../../../services/builder/dashboard3.service'; +import { BarChartComponent } from '../gadgets/bar-chart/bar-chart.component'; +import { BubbleChartComponent } from '../gadgets/bubble-chart/bubble-chart.component'; +import { DoughnutChartComponent } from '../gadgets/doughnut-chart/doughnut-chart.component'; +import { DynamicChartComponent } from '../gadgets/dynamic-chart/dynamic-chart.component'; +import { FinancialChartComponent } from '../gadgets/financial-chart/financial-chart.component'; +import { LineChartComponent } from '../gadgets/line-chart/line-chart.component'; +import { PieChartComponent } from '../gadgets/pie-chart/pie-chart.component'; +import { PolarChartComponent } from '../gadgets/polar-chart/polar-chart.component'; +import { RadarChartComponent } from '../gadgets/radar-chart/radar-chart.component'; +import { ScatterChartComponent } from '../gadgets/scatter-chart/scatter-chart.component'; +import { ToDoChartComponent } from '../gadgets/to-do-chart/to-do-chart.component'; +import { GridViewComponent } from '../gadgets/grid-view/grid-view.component'; +import { DatastoreService } from 'src/app/services/fnd/datastore.service'; +import { AlertsService } from 'src/app/services/fnd/alerts.service'; +import { isArray } from 'highcharts'; +// import { ChartItem } from '../chartitem'; + +function isNullArray(arr) { + return !Array.isArray(arr) || arr.length === 0; +} + +@Component({ + selector: 'app-editnewdash', + templateUrl: './editnewdash.component.html', + styleUrls: ['./editnewdash.component.scss'] +}) + + + +export class EditnewdashComponent implements OnInit { + + editId:number; + toggle:boolean; + modeledit:boolean = false; + public entryForm: FormGroup; + + WidgetsMock: WidgetModel[] = [ + { + name: 'Radar Chart', + identifier: 'radar_chart' + }, + { + name: 'Doughnut Chart', + identifier: 'doughnut_chart' + }, + { + name: 'Line Chart', + identifier: 'line_chart' + }, + { + name: 'Bar Chart', + identifier: 'bar_chart' + }, + { + name: 'Pie Chart', + identifier: 'pie_chart' + }, + { + name: 'Polar Area Chart', + identifier: 'polar_area_chart' + }, + { + name: 'Bubble Chart', + identifier: 'bubble_chart' + }, + { + name: 'Scatter Chart', + identifier: 'scatter_chart' + }, + // { + // name: 'Dynamic Chart', + // identifier: 'dynamic_chart' + // }, + // { + // name: 'Financial Chart', + // identifier: 'financial_chart' + // }, + { + name: 'To Do', + identifier: 'to_do_chart' + }, + { + name: 'Grid View', + identifier: 'grid_view' + } +] + + public options: GridsterConfig; + protected dashboardId: number; + protected dashboardCollection: DashboardModel; + //dashboardCollection:any; + protected dashboardCollection1: DashboardModel[]; + public dashboardArray: DashboardContentModel[]; + public dashArr:[]; + + protected componentCollection = [ + { name: "Line Chart", componentInstance: LineChartComponent }, + { name: "Doughnut Chart", componentInstance: DoughnutChartComponent }, + { name: "Radar Chart", componentInstance: RadarChartComponent }, + { name: "Bar Chart", componentInstance: BarChartComponent }, + { name: "Pie Chart", componentInstance: PieChartComponent }, + { name: "Polar Area Chart", componentInstance: PolarChartComponent }, + { name: "Bubble Chart", componentInstance: BubbleChartComponent }, + { name: "Scatter Chart", componentInstance: ScatterChartComponent }, + { name: "Dynamic Chart", componentInstance: DynamicChartComponent }, + { name: "Financial Chart", componentInstance: FinancialChartComponent }, + { name: "To Do Chart", componentInstance: ToDoChartComponent }, + { name: "Grid View", componentInstance: GridViewComponent }, + ]; + model:any; + linesdata:any; + id:any; + gadgetsEditdata = { + donut : '', + chartlegend: '', + showlabel : '', + charturl: '', + chartparameter : '', + datastore : '', + table:'', + datasource : '', + charttitle:'', + id:'', + fieldName:'', + chartcolor:'', + slices:'', + yAxis:'', + xAxis:'' + +}; + constructor(private route: ActivatedRoute, + private router : Router, + private dashboardService: Dashboard3Service, + private toastr:ToastrService, + private _fb: FormBuilder, + private datastoreService: DatastoreService, + private alertService:AlertsService,) { } + + ngOnInit(): void { + + // Grid options + this.options = { + gridType: "fit", + enableEmptyCellDrop: true, + emptyCellDropCallback: this.onDrop, + pushItems: true, + swap: true, + pushDirections: { north: true, east: true, south: true, west: true }, + resizable: { enabled: true }, + itemChangeCallback: this.itemChange.bind(this), + draggable: { + enabled: true, + ignoreContent: true, + dropOverItems: true, + dragHandleClass: "drag-handler", + ignoreContentClass: "no-drag", + }, + displayGrid: "always", + minCols: 10, + minRows: 10 + }; + this.getData(); + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log("ngOnInit",data); + this.linesdata = data; + this.id = data.dashbord1_Line[0].id; + console.log("this.id ",this.id); + }, + (error: any)=>{ + + } + ); + + this.entryForm = this._fb.group({ + donut : [null], + chartlegend: [null], + showlabel : [null], + charturl: [null], + chartparameter : [null], + datastore:[null], + table:[null], + fieldName: [null], + datasource : [null], + charttitle:[null], + id:[null], + chartcolor:[null], + slices:[null], + yAxis:[null], + xAxis: [null], + }); + } + + toggleMenu() { + this.toggle = !this.toggle; + } + + onDrag(event, identifier) { + console.log("on drag",identifier); + console.log("on drag ",event); + event.dataTransfer.setData('widgetIdentifier', identifier); + } + datagadgets:any; + dashboardLine:any; + dashboardName:any; + getData() { + // We get the id in get current router dashboard/:id + this.route.params.subscribe(params => { + // + is used to cast string to int + this.dashboardId = +params["id"]; + // We make a get request with the dashboard id + this.dashboardService.getById(this.dashboardId).subscribe(dashboard => { + // We fill our dashboardCollection with returned Observable + this.dashboardName = dashboard.dashboard_name; + this.datagadgets = dashboard; + this.dashboardLine = dashboard.dashbord1_Line; + //this.dashboardCollection = dashboard.dashbord1_Line.model; + console.log("this.datagadgets",this.datagadgets); + console.log("this.dashboardLine",this.dashboardLine); + this.dashboardCollection =JSON.parse(this.dashboardLine[0].model) ; + //this.dashboardCollection =this.dashboardLine[0].model ; + console.log("this.dasboard ",this.dashboardCollection ); + console.log(this.dashboardCollection); + // We parse serialized Json to generate components on the fly + this.parseJson(this.dashboardCollection); + // We copy array without reference + this.dashboardArray = this.dashboardCollection.dashboard.slice(); + console.log("this.dashboardArray",this.dashboardArray); + }); + }); + + + } + + // Super TOKENIZER 2.0 POWERED BY NATCHOIN + parseJson(dashboardCollection: DashboardModel) { + // We loop on our dashboardCollection + dashboardCollection.dashboard.forEach(dashboard => { + // We loop on our componentCollection + this.componentCollection.forEach(component => { + // We check if component key in our dashboardCollection + // is equal to our component name key in our componentCollection + if (dashboard.component === component.name) { + // If it is, we replace our serialized key by our component instance + dashboard.component = component.componentInstance; + } + }); + }); + } + + serialize(dashboardCollection) { + // We loop on our dashboardCollection + dashboardCollection.forEach(dashboard => { + // We loop on our componentCollection + this.componentCollection.forEach(component => { + // We check if component key in our dashboardCollection + // is equal to our component name key in our componentCollection + if (dashboard.name === component.name) { + dashboard.component = component.name; + } + }); + }); + } + + itemChange() { + this.dashboardCollection.dashboard = this.dashboardArray; + console.log("itemChange this.dashboardCollection.dashboard ",this.dashboardCollection.dashboard); + console.log("itemChange this.dashboardCollection ",this.dashboardCollection); + console.log("itemChange this.dashboardCollection type",typeof this.dashboardCollection); + console.log("itemChange this.dashboardArray ",this.dashboardArray); + let tmp = JSON.stringify(this.dashboardCollection); + console.log("temp data",tmp); + let parsed: DashboardModel = JSON.parse(tmp); + console.log("parsed data",parsed); + console.log("let parsed ",typeof parsed); + this.serialize(parsed.dashboard); + console.log("item chnage function ", typeof this.dashboardArray); + //this._ds.updateDashboard(this.dashboardId, parsed).subscribe(); + } + + onDrop(ev) { + const componentType = ev.dataTransfer.getData("widgetIdentifier"); + let maxChartId = this.dashboardArray?.reduce((maxId, item) => Math.max(maxId, item.chartid), 0); + switch (componentType) { + case "radar_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: RadarChartComponent, + name: "Radar Chart" + }); + case "line_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 7, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: LineChartComponent, + name: "Line Chart" + }); + case "doughnut_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: DoughnutChartComponent, + name: "Doughnut Chart" + }); + case "bar_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: BarChartComponent, + name: "Bar Chart" + }); + case "pie_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: PieChartComponent, + name: "Pie Chart" + }); + case "polar_area_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: PolarChartComponent, + name: "Polar Area Chart" + }); + case "bubble_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: BubbleChartComponent, + name: "Bubble Chart" + }); + case "scatter_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: ScatterChartComponent, + name: "Scatter Chart" + }); + case "dynamic_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: DynamicChartComponent, + name: "Dynamic Chart" + }); + case "financial_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 6, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: FinancialChartComponent, + name: "Financial Chart" + }); + case "to_do_chart": + return this.dashboardArray.push({ + cols: 5, + rows: 5, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: ToDoChartComponent, + name: "To Do Chart" + }); + case "grid_view": + return this.dashboardArray.push({ + cols: 5, + rows: 5, + x: 0, + y: 0, + chartid:maxChartId + 1, + component: GridViewComponent, + name: "Grid View" + }); + } + } + removeItem(item) { + this.dashboardArray.splice( + this.dashboardArray.indexOf(item), + 1 + ); + this.itemChange(); + } + + changedOptions() { + this.options.api.optionsChanged(); + } + + modelid:number ; + editGadget(item) + { + this.modeledit = true; + this.modelid = item.chartid; + console.log(this.modelid); + this.gadgetsEditdata = item; + this.gadgetsEditdata.fieldName = item.name; + if(item.showlabel === undefined){ item.showlabel = true; } + if(item.chartcolor === undefined ){ item.chartcolor = true;} + if(item.chartlegend === undefined){ item.chartlegend = true; } + this.getStores(); + if(item.datastore !== undefined || '' || null){ + const datastore = item.datastore; + this.getTables(datastore); + const table = item.table; + this.getColumns(datastore,table); + console.log(item.yAxis); + if(isArray(item.yAxis)){ + this.selectedyAxis = item.yAxis; + console.log( this.selectedyAxis); + } + }else{ + this.selectedyAxis = []; + } + console.log(item); + } + + dashbord1_Line = { + //model:JSON.stringify(this.da), + model:'' + } + + + UpdateLine() + { + console.log('Add button clicked.......'); + console.log(this.dashboardArray); + console.log(this.dashboardCollection); + console.log(typeof this.dashboardCollection); + console.log(this.id); + //this.dashbord1_Line.model = JSON.stringify(this.dashboardCollection); + + //https://www.w3schools.com/js/tryit.asp?filename=tryjson_stringify_function_tostring + +let cmp=this.dashboardCollection.dashboard.forEach(dashboard=>{ + this.componentCollection.forEach(component=>{ + if (dashboard.name === component.name) { + dashboard.component = component.name; + } }) +}) +console.log(cmp); + + let tmp = JSON.stringify(this.dashboardCollection); + // var merged = this.dashboardArray.reduce((current, value, index) => { + // if(index > 0) + // current += ','; + + // return current + value.component; + // }, ''); + + //console.log(merged); + console.log("temp data",typeof tmp); + console.log(tmp); + let parsed= JSON.parse(tmp); + this.serialize(parsed.dashboard); + this.dashbord1_Line.model = tmp; + + // let obj = this.dashboardCollection; + // obj[1].component = obj[1].component.toString(); + // let myJSON = JSON.stringify(obj); + // this.dashbord1_Line.model = myJSON; + + console.log("line data in addgadget ",this.dashbord1_Line); + console.log("line data in addgadget type ",typeof this.dashbord1_Line); + console.log("line model data ",this.dashbord1_Line.model); + console.log("line model data type",typeof this.dashbord1_Line.model); + this.dashboardService.UpdateLineData(this.id,this.dashbord1_Line).subscribe( + (data: any)=>{ + console.log('Updation Successful...'); + this.ngOnInit(); + console.log(data); + this.router.navigate(["../../all"], { relativeTo: this.route }) + } + ); + // if (data) { + // this.toastr.success('Updated successfully'); + // } + } + + onSubmit(id) + { + console.log(id); + if (!isNullArray(this.selectedyAxis)) { + console.log("get y-axis array", this.selectedyAxis); + this.entryForm.patchValue({ yAxis: this.selectedyAxis }); + } + let formdata = this.entryForm.value; + let num = id; + console.log(this.entryForm.value); + this.dashboardCollection.dashboard = this.dashboardCollection.dashboard.map(item => { + if(item.chartid == num) + { + //item["product_id"] = "thisistest"; + const xyz = {...item,...formdata} + console.log(xyz); + return xyz; + } + return item + }); + console.log(this.dashboardCollection.dashboard); + this.modeledit = false; + + // this.entryForm.reset(); + + } + goBack(){ + this.router.navigate(["../../all"], { relativeTo: this.route }) + } + + onSchedule(){ + this.router.navigate(['../../schedule/'+ this.editId],{relativeTo:this.route}); + } + + + /////// + storedata; + getStores(){ + this.datastoreService.getAll().subscribe((data) => { + console.log(data); + this.storedata = data; + },(error) => { + console.log(error); + }); + } + + selectedStoreId; + storename(val){ + console.log(val); + this.selectedStoreId = val; + this.getTables(this.selectedStoreId); + } + + TableData; + getTables(id){ + this.alertService.getTablefromstore(id).subscribe(gateway =>{ + console.log(gateway); + this.TableData = gateway; + },(error)=>{ + console.log(error); + }); + } + + tablename(val){ + console.log(val); + this.getColumns(this.selectedStoreId,val); + } + selectedyAxis; + columnData; + getColumns(id,table){ + this.alertService.getColumnfromurl(table).subscribe(data =>{ + console.log(data); + this.columnData = data; + },(error)=>{ + console.log(error); + }); + } + + + // toggleAddToDashboard(item) { + // item.addToDashboard = item.addToDashboard; + // } + + // getChartDataForToggleSwitchTrue() { + // for (let i = 0; i < this.dashArr.length; i++) { + // if (this.dashArr[i].addToDashboard) { + // this.dashboardService.getChartData( + // this.dashArr[i].charturl, // Assuming charturl is the correct property to pass as a string + // true // Pass true to indicate fetching charts with toggle switch set to true + // ).subscribe(tData => { + // console.log(tData); + // // this.dashArr[i].featchData = tData; + // }); + // } + // } + // } + + + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.css new file mode 100644 index 0000000..dc9ed07 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=bar-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.css.map new file mode 100644 index 0000000..e0b82da --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"bar-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.html new file mode 100644 index 0000000..0fa4df5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.html @@ -0,0 +1,9 @@ +
+ + +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.spec.ts new file mode 100644 index 0000000..0fd6253 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BarChartComponent } from './bar-chart.component'; + +describe('BarChartComponent', () => { + let component: BarChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BarChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BarChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.ts new file mode 100644 index 0000000..1d2c277 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bar-chart/bar-chart.component.ts @@ -0,0 +1,33 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-bar-chart', + templateUrl: './bar-chart.component.html', + styleUrls: ['./bar-chart.component.scss'] +}) +export class BarChartComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + barChartLabels: string[] = ['Apple', 'Banana', 'Kiwifruit', 'Blueberry', 'Orange', 'Grapes']; + barChartType: string = 'bar'; + // barChartLegend = true; + barChartPlugins = []; + barChartData: any[] = [ + { data: [45, 37, 60, 70, 46, 33], label: 'Best Fruits' } + ]; + + + + // events + public chartClicked(e: any): void { + console.log(e); + } + + public chartHovered(e: any): void { + console.log(e); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.css new file mode 100644 index 0000000..68bf163 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=bubble-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.css.map new file mode 100644 index 0000000..ca59a26 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"bubble-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.html new file mode 100644 index 0000000..5f6157d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.html @@ -0,0 +1,9 @@ +
+ + +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.spec.ts new file mode 100644 index 0000000..6f37403 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BubbleChartComponent } from './bubble-chart.component'; + +describe('BubbleChartComponent', () => { + let component: BubbleChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BubbleChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BubbleChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.ts new file mode 100644 index 0000000..b01a8b0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component.ts @@ -0,0 +1,98 @@ +import { Component, OnInit } from '@angular/core'; +import { ChartConfiguration, ChartDataset, ChartOptions } from 'chart.js'; +@Component({ + selector: 'app-bubble-chart', + templateUrl: './bubble-chart.component.html', + styleUrls: ['./bubble-chart.component.scss'] +}) +export class BubbleChartComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + public bubbleChartOptions: ChartConfiguration['options'] = { + // scales: { + // x: { + // min: 0, + // max: 30, + // ticks: {} + // }, + // y: { + // min: 0, + // max: 30, + // ticks: {} + // }, + // plugins: { + // title: { + // display: true, + // text: 'Bubble Chart' + // } + // } + // } + }; + + public bubbleChartType: string = 'bubble'; + // public bubbleChartLegend = true; + public bubbleChartData: ChartDataset[] = [ + { + data: [ + { x: 10, y: 10, r: 10 }, + { x: 15, y: 5, r: 15 }, + { x: 26, y: 12, r: 23 }, + { x: 7, y: 8, r: 8 }, + ], + label: 'Investment Equities', + backgroundColor: 'rgba(255, 0, 0, 0.6)', // Red + borderColor: 'blue', + hoverBackgroundColor: 'purple', + hoverBorderColor: 'red', + }, + { + data: [ + { x: 5, y: 15, r: 12 }, + { x: 20, y: 7, r: 8 }, + { x: 12, y: 18, r: 15 }, + { x: 8, y: 6, r: 10 }, + ], + label: 'Investment Bonds', + backgroundColor: 'rgba(0, 255, 0, 0.6)', // Green + borderColor: 'green', + hoverBackgroundColor: 'yellow', + hoverBorderColor: 'blue', + }, + // { + // data: [ + // { x: 10, y: 10, r: 10 }, + // { x: 15, y: 5, r: 15 }, + // { x: 26, y: 12, r: 23 }, + // { x: 7, y: 8, r: 8 }, + // ], + // label: 'Investment Equities', + // backgroundColor: [ + // 'red', + // 'green', + // 'blue', + // 'purple', + // 'yellow', + // 'brown', + // 'magenta', + // 'cyan', + // 'orange', + // 'pink' + // ], + // borderColor: 'blue', + // hoverBackgroundColor: 'purple', + // hoverBorderColor: 'red', + // }, + ]; + + // events + public chartClicked(e: any): void { + console.log(e); + } + + public chartHovered(e: any): void { + console.log(e); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.css new file mode 100644 index 0000000..f7a6815 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=doughnut-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.css.map new file mode 100644 index 0000000..b06f027 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"doughnut-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.html new file mode 100644 index 0000000..cab5b29 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.html @@ -0,0 +1,8 @@ +
+ +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.spec.ts new file mode 100644 index 0000000..6730967 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DoughnutChartComponent } from './doughnut-chart.component'; + +describe('DoughnutChartComponent', () => { + let component: DoughnutChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DoughnutChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DoughnutChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.ts new file mode 100644 index 0000000..137455b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component.ts @@ -0,0 +1,30 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-doughnut-chart', + templateUrl: './doughnut-chart.component.html', + styleUrls: ['./doughnut-chart.component.scss'] +}) +export class DoughnutChartComponent implements OnInit { + public doughnutChartLabels: string[] = [ + "Download Sales", + "In-Store Sales", + "Mail-Order Sales" + ]; + public doughnutChartData: number[] = [350, 450, 100]; + public doughnutChartType: string = "doughnut"; + + // events + public chartClicked(e: any): void { + console.log(e); + } + + public chartHovered(e: any): void { + console.log(e); + } + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.css new file mode 100644 index 0000000..c95881a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=dynamic-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.css.map new file mode 100644 index 0000000..0d29454 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"dynamic-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.html new file mode 100644 index 0000000..e00b379 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.html @@ -0,0 +1,10 @@ +
+ + +
+ diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.spec.ts new file mode 100644 index 0000000..fc47783 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DynamicChartComponent } from './dynamic-chart.component'; + +describe('DynamicChartComponent', () => { + let component: DynamicChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DynamicChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DynamicChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.ts new file mode 100644 index 0000000..2173924 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component.ts @@ -0,0 +1,70 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ChartConfiguration, ChartData, } from 'chart.js'; +import { BaseChartDirective } from 'ng2-charts'; +@Component({ + selector: 'app-dynamic-chart', + templateUrl: './dynamic-chart.component.html', + styleUrls: ['./dynamic-chart.component.scss'] +}) +export class DynamicChartComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + @ViewChild(BaseChartDirective) chart: BaseChartDirective | undefined; + + public barChartOptions: ChartConfiguration['options'] = { + elements: { + line: { + tension: 0.4 + } + }, + // We use these empty structures as placeholders for dynamic theming. + // scales: { + // x: {}, + // y: { + // min: 10 + // } + // }, + plugins: { + legend: { display: true }, + } + }; + public dynamicChartLabels: string[] = [ '2006', '2007', '2008', '2009', '2010', '2011', '2012' ]; + public barChartType: string = 'bar'; + + // public barChartData: ChartData<'bar'> = { + // labels: this.barChartLabels, + // datasets: [ + // { data: [ 65, 59, 80, 81, 56, 55, 40 ], label: 'Series A' }, + // { data: [ 28, 48, 40, 19, 86, 27, 90 ], label: 'Series B' } + // ] + // }; + + + public dynamicChartData: any = [ + { data: [65, 59, 90, 81, 56, 55, 40], label: "Series A" }, + { data: [28, 48, 40, 19, 96, 27, 100], label: "Series B" } + ]; + + // events + public chartClicked(e: any): void { + console.log(e); + } + + public chartHovered(e: any): void { + console.log(e); + } + // public chartClicked({ event, active }: { event?: ChartEvent, active?: {}[] }): void { + // console.log(event, active); + // } + + // public chartHovered({ event, active }: { event?: ChartEvent, active?: {}[] }): void { + // console.log(event, active); + // } + + public randomize(): void { + this.barChartType = this.barChartType === 'bar' ? 'line' : 'bar'; + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.css new file mode 100644 index 0000000..ac86a4e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=financial-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.css.map new file mode 100644 index 0000000..b2642ea --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"financial-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.html new file mode 100644 index 0000000..56547d5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.html @@ -0,0 +1 @@ +

financial-chart works!

diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.spec.ts new file mode 100644 index 0000000..8b12e17 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FinancialChartComponent } from './financial-chart.component'; + +describe('FinancialChartComponent', () => { + let component: FinancialChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ FinancialChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(FinancialChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.ts new file mode 100644 index 0000000..664e7cd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/financial-chart/financial-chart.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-financial-chart', + templateUrl: './financial-chart.component.html', + styleUrls: ['./financial-chart.component.scss'] +}) +export class FinancialChartComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.css new file mode 100644 index 0000000..62b150c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.css @@ -0,0 +1,72 @@ +input[type=text], [type=date], [type=password] { + width: 100%; + padding: 15px 20px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.required-field { + color: red; + font-size: 18px; +} + +.green { + background-color: rgb(156, 231, 156); + color: black; +} + +.blue { + background-color: #57abcf; + color: black; +} + +.td-title { + text-align: center; + width: 150px; + color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); +} + +th { + background-color: rgb(170, 169, 169); + font-weight: bold; +} + +.td-content { + text-align: left; +} + +.delete, .heading { + text-align: center; + color: red; +} + +.section p { + background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} + +clr-datagrid { + height: 400px; /* Adjust the height as needed */ + overflow-y: auto; +}/*# sourceMappingURL=grid-view.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.css.map new file mode 100644 index 0000000..b6dcdc3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../../../styles1.scss","grid-view.component.css","grid-view.component.scss"],"names":[],"mappings":"AAAA;EACE,WAAA;EACA,kBAAA;EAED,oCAAA;EACC,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACAF;;ADEA;EACE,UAAA;EACF,eAAA;ACCA;;ADEA;EACE,oCAAA;EACA,YAAA;ACCF;;ADCA;EACE,yBAAA;EACA,YAAA;ACEF;;ADAA;EACE,kBAAA;EACA,YAAA;EACF,YAAA;EACE,iBAAA;EACA,2CAAA;ACGF;;ADAA;EACE,oCAAA;EACA,iBAAA;ACGF;;ADDA;EACE,gBAAA;ACIF;;ADFA;EACE,kBAAA;EACA,UAAA;ACKF;;ADHA;EACA,oCAAA;EACE,aAAA;EACA,eAAA;ACMF;;ADHA;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACMF;;ACzDA;EACE,iBAAA;AD4DF;;ACzDA;EACE,UAAA;AD4DF;;AC1DA;EACI,aAAA,EAAA,gCAAA;EACF,gBAAA;AD6DF","file":"grid-view.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.html new file mode 100644 index 0000000..94c1edc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.html @@ -0,0 +1,69 @@ +
+
+
+
+

User Group Maintenance

+
+
+ + Loading ... +
{{error}}
+ + + User Group No + + + Group Name + + + Description + + + Group Level + + + Status + + + + Updated Date + + + + + {{user.usrGrp}} + {{user.groupName}} + {{user.groupDesc}} + {{user.groupLevel}} + {{user.status}} + + {{user.updateDateFormated}} + + + + + + + + + Record per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} Records + + +
+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.scss new file mode 100644 index 0000000..99c5f44 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.scss @@ -0,0 +1,12 @@ +@import '../../../../../../../styles1.scss'; +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} +clr-datagrid{ + height: 400px; /* Adjust the height as needed */ + overflow-y: auto; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.spec.ts new file mode 100644 index 0000000..0353984 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GridViewComponent } from './grid-view.component'; + +describe('GridViewComponent', () => { + let component: GridViewComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ GridViewComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(GridViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.ts new file mode 100644 index 0000000..dfb2de1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/grid-view/grid-view.component.ts @@ -0,0 +1,54 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ExcelService } from 'src/app/services/excel.service'; +import * as moment from 'moment'; +import { UsergrpmaintainceService } from 'src/app/services/admin/usergrpmaintaince.service'; +import { ToastrService } from 'ngx-toastr'; +import { MenuGroupService } from 'src/app/services/admin/menu-group.service'; +@Component({ + selector: 'app-grid-view', + templateUrl: './grid-view.component.html', + styleUrls: ['./grid-view.component.scss'] +}) +export class GridViewComponent implements OnInit { + loading = false; + public entryForm: FormGroup; + givendata; + orders; + error; + modalAdd= false; + modaledit=false; + modaldelete=false; + rowSelected :any= {}; + mcreate; + medit; + showdata; + submitted=false; + + constructor( + private excel: ExcelService, + private toastr:ToastrService, + private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private menuGroupService: MenuGroupService, + private mainservice:UsergrpmaintainceService, + ) { } + + ngOnInit(): void { + this.mainservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + if(this.givendata.length==0){ + this.error="No data Available"; + console.log(this.error) + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.css new file mode 100644 index 0000000..630d4cd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=line-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.css.map new file mode 100644 index 0000000..36b4be5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"line-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.html new file mode 100644 index 0000000..18c620d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.html @@ -0,0 +1,12 @@ +
+ +
+ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.spec.ts new file mode 100644 index 0000000..0c5e7ef --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LineChartComponent } from './line-chart.component'; + +describe('LineChartComponent', () => { + let component: LineChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ LineChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(LineChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.ts new file mode 100644 index 0000000..3eaad81 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/line-chart/line-chart.component.ts @@ -0,0 +1,71 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-line-chart', + templateUrl: './line-chart.component.html', + styleUrls: ['./line-chart.component.scss'] +}) +export class LineChartComponent implements OnInit { + public lineChartData:Array = [ + {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'}, + {data: [28, 48, 40, 19, 86, 27, 90], label: 'Series B'}, + {data: [18, 48, 77, 9, 100, 27, 40], label: 'Series C'} + ]; + public lineChartLabels:Array = ['January', 'February', 'March', 'April', 'May', 'June', 'July']; + public lineChartOptions:any = { + responsive: true + }; + public lineChartColors:Array = [ + { // grey + backgroundColor: 'rgba(148,159,177,0.2)', + borderColor: 'rgba(148,159,177,1)', + pointBackgroundColor: 'rgba(148,159,177,1)', + pointBorderColor: '#fff', + pointHoverBackgroundColor: '#fff', + pointHoverBorderColor: 'rgba(148,159,177,0.8)' + }, + { // dark grey + backgroundColor: 'rgba(77,83,96,0.2)', + borderColor: 'rgba(77,83,96,1)', + pointBackgroundColor: 'rgba(77,83,96,1)', + pointBorderColor: '#fff', + pointHoverBackgroundColor: '#fff', + pointHoverBorderColor: 'rgba(77,83,96,1)' + }, + { // grey + backgroundColor: 'rgba(148,159,177,0.2)', + borderColor: 'rgba(148,159,177,1)', + pointBackgroundColor: 'rgba(148,159,177,1)', + pointBorderColor: '#fff', + pointHoverBackgroundColor: '#fff', + pointHoverBorderColor: 'rgba(148,159,177,0.8)' + } + ]; + public lineChartLegend:boolean = true; + public lineChartType:string = 'line'; + + public randomize():void { + let _lineChartData:Array = new Array(this.lineChartData.length); + for (let i = 0; i < this.lineChartData.length; i++) { + _lineChartData[i] = {data: new Array(this.lineChartData[i].data.length), label: this.lineChartData[i].label}; + for (let j = 0; j < this.lineChartData[i].data.length; j++) { + _lineChartData[i].data[j] = Math.floor((Math.random() * 100) + 1); + } + } + this.lineChartData = _lineChartData; + } + + // events + public chartClicked(e:any):void { + console.log(e); + } + + public chartHovered(e:any):void { + console.log(e); + } + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.css new file mode 100644 index 0000000..973bd02 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=pie-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.css.map new file mode 100644 index 0000000..a06051f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"pie-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.html new file mode 100644 index 0000000..ef42eed --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.html @@ -0,0 +1,9 @@ +
+ + +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.spec.ts new file mode 100644 index 0000000..64f36b7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PieChartComponent } from './pie-chart.component'; + +describe('PieChartComponent', () => { + let component: PieChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PieChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PieChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.ts new file mode 100644 index 0000000..a6647a6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/pie-chart/pie-chart.component.ts @@ -0,0 +1,27 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-pie-chart', + templateUrl: './pie-chart.component.html', + styleUrls: ['./pie-chart.component.scss'] +}) +export class PieChartComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + public pieChartLabels: string[] = ['SciFi', 'Drama', 'Comedy']; + public pieChartData: number[] = [30, 50, 20]; + public pieChartType: string = 'pie'; + + // events + public chartClicked(e: any): void { + console.log(e); + } + + public chartHovered(e: any): void { + console.log(e); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.css new file mode 100644 index 0000000..1e3f682 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=polar-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.css.map new file mode 100644 index 0000000..7c2253e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"polar-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.html new file mode 100644 index 0000000..421e078 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.html @@ -0,0 +1,10 @@ + +
+ + +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.spec.ts new file mode 100644 index 0000000..8501fbc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PolarChartComponent } from './polar-chart.component'; + +describe('PolarChartComponent', () => { + let component: PolarChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PolarChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PolarChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.ts new file mode 100644 index 0000000..56652fe --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/polar-chart/polar-chart.component.ts @@ -0,0 +1,37 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-polar-chart', + templateUrl: './polar-chart.component.html', + styleUrls: ['./polar-chart.component.scss'] +}) +export class PolarChartComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + public polarAreaChartLabels: string[] = [ 'Download Sales', 'In-Store Sales', 'Mail Sales', 'Telesales', 'Corporate Sales' ]; + public polarAreaChartData: any = [ + { data: [ 300, 500, 100, 40, 120 ], label: 'Series 1'} + ]; + + public polarAreaChartType: string = 'polarArea'; + + + + // public radarChartData: any = [ + // { data: [65, 59, 90, 81, 56, 55, 40], label: "Series A" }, + // { data: [28, 48, 40, 19, 96, 27, 100], label: "Series B" } + // ]; + + // events + public chartClicked(e: any): void { + console.log(e); + } + + public chartHovered(e: any): void { + console.log(e); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.css new file mode 100644 index 0000000..b255a4d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=radar-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.css.map new file mode 100644 index 0000000..0e85db2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"radar-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.html new file mode 100644 index 0000000..3b26b0a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.html @@ -0,0 +1,8 @@ +
+ +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.spec.ts new file mode 100644 index 0000000..a5d9784 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RadarChartComponent } from './radar-chart.component'; + +describe('RadarChartComponent', () => { + let component: RadarChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ RadarChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(RadarChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.ts new file mode 100644 index 0000000..3c23092 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/radar-chart/radar-chart.component.ts @@ -0,0 +1,39 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-radar-chart', + templateUrl: './radar-chart.component.html', + styleUrls: ['./radar-chart.component.scss'] +}) +export class RadarChartComponent implements OnInit { +// Radar +public radarChartLabels: string[] = [ + "Eating", + "Drinking", + "Sleeping", + "Designing", + "Coding", + "Cycling", + "Running" +]; + +public radarChartData: any = [ + { data: [65, 59, 90, 81, 56, 55, 40], label: "Series A" }, + { data: [28, 48, 40, 19, 96, 27, 100], label: "Series B" } +]; +public radarChartType: string = "radar"; + +// events +public chartClicked(e: any): void { + console.log(e); +} + +public chartHovered(e: any): void { + console.log(e); +} + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.css new file mode 100644 index 0000000..2b5057d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=scatter-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.css.map new file mode 100644 index 0000000..4007ce6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"scatter-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.html new file mode 100644 index 0000000..e0b67e3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.html @@ -0,0 +1,8 @@ +
+ + +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.spec.ts new file mode 100644 index 0000000..70c8481 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ScatterChartComponent } from './scatter-chart.component'; + +describe('ScatterChartComponent', () => { + let component: ScatterChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ScatterChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ScatterChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.ts new file mode 100644 index 0000000..1af87bc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component.ts @@ -0,0 +1,77 @@ +import { Component, OnInit } from '@angular/core'; +import { ChartData,ChartDataset } from 'chart.js'; + +@Component({ + selector: 'app-scatter-chart', + templateUrl: './scatter-chart.component.html', + styleUrls: ['./scatter-chart.component.scss'] +}) +export class ScatterChartComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + public scatterChartLabels: string[] = [ 'Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running' ]; + + public scatterChartData: ChartDataset[] = [ + // { + // data: [ + // { x: 1, y: 1 }, + // { x: 2, y: 3 }, + // { x: 3, y: -2 }, + // { x: 4, y: 4 }, + // { x: 5, y: -3, r: 20 }, + // ], + // label: 'Series A', + // pointRadius: 10, + // backgroundColor: 'red', + // }, + // { + // data: [ + // { x: 2, y: 2 }, + // { x: 3, y: 1 }, + // { x: 4, y: 3 }, + // { x: 5, y: 2 }, + // { x: 6, y: 4, r: 15 }, + // ], + // label: 'Series B', + // pointRadius: 8, + // backgroundColor: 'green', + // }, + { + data: [ + { x: 1, y: 1 }, + { x: 2, y: 3 }, + { x: 3, y: -2 }, + { x: 4, y: 4 }, + { x: 5, y: -3, r: 20 }, + ], + label: 'Series A', + pointRadius: 10, + backgroundColor: [ + 'red', + 'green', + 'blue', + 'purple', + 'yellow', + 'brown', + 'magenta', + 'cyan', + 'orange', + 'pink' + ], + }, + ]; + public scatterChartType: string = 'scatter'; + + + // events + public chartClicked(e: any): void { + console.log(e); + } + + public chartHovered(e: any): void { + console.log(e); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.css new file mode 100644 index 0000000..1a0ea87 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=to-do-chart.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.css.map new file mode 100644 index 0000000..5fe3143 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"to-do-chart.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.html new file mode 100644 index 0000000..c9e47d0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + +
#Item
{{i + 1}}{{todo}} + + + +
+ + + + + +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.spec.ts new file mode 100644 index 0000000..a489ab6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ToDoChartComponent } from './to-do-chart.component'; + +describe('ToDoChartComponent', () => { + let component: ToDoChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ToDoChartComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ToDoChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.ts new file mode 100644 index 0000000..481fcca --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component.ts @@ -0,0 +1,27 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-to-do-chart', + templateUrl: './to-do-chart.component.html', + styleUrls: ['./to-do-chart.component.scss'] +}) +export class ToDoChartComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + data: any; + todo: string; + todoList = ['todo 1']; + + public addTodo(todo: string) { + this.todoList.push(todo); +} + +public removeTodo(todoIx: number) { + if (this.todoList.length) { + this.todoList.splice(todoIx, 1); + } +} +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.html new file mode 100644 index 0000000..0b4b913 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.html @@ -0,0 +1 @@ +

schedule works!

diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.spec.ts new file mode 100644 index 0000000..74a139d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ScheduleComponent } from './schedule.component'; + +describe('ScheduleComponent', () => { + let component: ScheduleComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [ScheduleComponent] + }); + fixture = TestBed.createComponent(ScheduleComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.ts new file mode 100644 index 0000000..5848b8b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/schedule/schedule.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-schedule', + templateUrl: './schedule.component.html', + styleUrls: ['./schedule.component.scss'] +}) +export class ScheduleComponent { + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.spec.ts new file mode 100644 index 0000000..f034e08 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardrunnerComponent } from './dashboardrunner.component'; + +describe('DashboardrunnerComponent', () => { + let component: DashboardrunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DashboardrunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DashboardrunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.ts new file mode 100644 index 0000000..f18f267 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashboardrunner.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-dashboardrunner', + templateUrl: './dashboardrunner.component.html', + styleUrls: ['./dashboardrunner.component.scss'] +}) +export class DashboardrunnerComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.css new file mode 100644 index 0000000..802d40f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.css @@ -0,0 +1,90 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; +} + +.td-content { + text-align: left; +} + +.delete, .heading { + text-align: center; + color: red; +} + +input[type=radio] { + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; +} + +.dots { + width: 100px; + height: 100px; + bordeR: 1px solid; + border-radius: 50%; +} + +h4 { + margin-top: 16px; +} + +.s-order-dash-pg { + margin: 0px; + display: flex; + flex-wrap: wrap; + flex-direction: row; + justify-content: center; +} +.s-order-dash-pg .chart-box { + margin: 16px; + padding: 0 16px; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 2px; +} + +#word1 { + width: 190px; + height: 180px; +} + +.center { + text-align: center; + margin-top: 5px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.heading { + text-align: center; + color: red; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +}/*# sourceMappingURL=dashrunnerall.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.css.map new file mode 100644 index 0000000..d4abb49 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["dashrunnerall.component.scss","dashrunnerall.component.css"],"names":[],"mappings":"AAAA;EACI,iBAAA;EACA,YAAA;EACA,iBAAA;EACA,2CAAA;EACA,YAAA;ACCJ;;ADCE;EACE,gBAAA;ACEJ;;ADAE;EACE,kBAAA;EACA,UAAA;ACGJ;;ADDE;EACE,sBAAA;EACA,uBAAA;EACA,WAAA;EACA,wBAAA;EACA,qBAAA;EACA,mBAAA;EACA,gBAAA;EACA,uBAAA;EACA,gBAAA;EACA,gBAAA;EACA,kBAAA;EACA,gBAAA;EACA,eAAA;ACIJ;;ADFE;EAEE,YAAA;EACA,aAAA;EACA,iBAAA;EACA,kBAAA;ACIJ;;ADDI;EAAG,gBAAA;ACKP;;ADJI;EACE,WAAA;EACA,aAAA;EACA,eAAA;EACA,mBAAA;EACA,uBAAA;ACON;ADNM;EACE,YAAA;EACA,eAAA;EACA,sBAAA;EACA,sBAAA;EACA,kBAAA;ACQR;;ADLI;EACC,YAAA;EACC,aAAA;ACQN;;ADLI;EACE,kBAAA;EACA,eAAA;ACQN;;ADLI;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACQN;;ADNM;EACE,kBAAA;EACA,UAAA;ACSR;;ADNM;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACSR","file":"dashrunnerall.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.html new file mode 100644 index 0000000..74d44e3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.html @@ -0,0 +1,117 @@ + + +
+ +
+
+
+

{{ 'all_dashboard' | translate }}

+
+
+ +
+
+ + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+ {{app.dashboard_name}} +
+
+ +
+
+ {{app.description}} +
+
+
+ + +
+ + + + +
+
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.scss new file mode 100644 index 0000000..48905e0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.scss @@ -0,0 +1,93 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; + } + .td-content{ + text-align: left; + } + .delete,.heading{ + text-align: center; + color: red; + } + input[type='radio']{ + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; + } + .dots + { + width: 100px; + height:100px; + border: 1px solid; + border-radius: 50%; + //background-color: #f00; + } + h4{margin-top: 16px;} + .s-order-dash-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + } + } + #word1{ + width: 190px; + height: 180px; + + } + .center{ + text-align: center; + margin-top: 5px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + .heading{ + text-align: center; + color: red; + } + + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + + + #word { + display: inline-block; + width: 320px; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + font-weight: bold; + + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.spec.ts new file mode 100644 index 0000000..0b6bc3a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashrunnerallComponent } from './dashrunnerall.component'; + +describe('DashrunnerallComponent', () => { + let component: DashrunnerallComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DashrunnerallComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DashrunnerallComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.ts new file mode 100644 index 0000000..ba27793 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerall/dashrunnerall.component.ts @@ -0,0 +1,125 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +// import { WireframeService } from 'src/app/services/builder/wireframe.service'; +import { ExcelService } from 'src/app/services/excel.service'; +import { Dashboard3Service } from '../../../../../services/builder/dashboard3.service'; +import * as moment from 'moment'; +import { ModulesetupService } from 'src/app/services/builder/modulesetup.service'; +@Component({ + selector: 'app-dashrunnerall', + templateUrl: './dashrunnerall.component.html', + styleUrls: ['./dashrunnerall.component.scss'] +}) +export class DashrunnerallComponent implements OnInit { + addModall:boolean = false; + selected:any[] = []; + loading = false; + data:any; + id:any; + moduleId:any; + modalDelete = false; + rowSelected :any= {}; + rows: any[]; + projectname; + projectId; + error; + constructor( + private router : Router, + private route: ActivatedRoute,private dashboardService : Dashboard3Service, + // private wireframeservice : WireframeService, + private excel: ExcelService,private mainService: ModulesetupService, + private toastr: ToastrService,) { } + + ngOnInit(): void { + // this.projectId=this.wireframeservice.getProjectId(); + console.log(this.projectId); + this.id = this.route.snapshot.params["id"]; // fb_header_id + // this.moduleId = this.wireframeservice.getModuleId(); // get from session storage + console.log(this.moduleId); + + this.getdashboard(); + // this.getprojectName(this.projectId); + } + + getprojectName(id){ + this.mainService.getProjectModules(id).subscribe((data) => { + console.log(data); + this.projectname=data.items[0]['projectName']; + console.log(this.projectname); + }); + } + + + getdashboard() + { + this.dashboardService.getAllDash().subscribe((data) =>{ + this.data = data; + this.rows = this.data; + console.log(data); + this.error="No data Available"; + console.log(this.error); + }); + } + + openModal() + { + this.addModall = true; + } + gotoadd() + { + this.router.navigate(['../../dashboardbuilder'],{relativeTo:this.route}); + } + goToEdit(id:number) + { + this.router.navigate(['../dashrunner/'+id],{relativeTo:this.route}); + } + + goToEditData(id: number){ + this.router.navigate(['../editdata/'+id],{relativeTo:this.route}); + } + + onExport() { + this.excel.exportAsExcelFile(this.rows, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + + gotoAction(){ + this.router.navigate(["../../actions"], { relativeTo: this.route, queryParams: { m_id: this.moduleId,pname:this.projectname } }); + } + gotoRepo(){ + this.router.navigate(["../../modulecard"], { relativeTo: this.route, queryParams: { p_id: this.projectId } }); + } + + onDelete(row){ + this.rowSelected = row; + console.log(this.rowSelected); + this.modalDelete = true; + } + delete(id) + { + this.modalDelete = false; + console.log("in delete "+id); + this.dashboardService.deleteField(id).subscribe((data)=>{ + console.log(data); + this.ngOnInit(); + }); + if (id) { + this.toastr.success('Deleted successfully'); + } + } + // openModal() + // { + // this.addModall = true; + // } + // gotoadd() + // { + // this.router.navigate(['../adddata'],{relativeTo:this.route}); + // } + // goToEdit() + // { + // this.router.navigate(['../editdashn'],{relativeTo:this.route}); + // } + +} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.html new file mode 100644 index 0000000..1e6cc60 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.html @@ -0,0 +1,38 @@ +
+
+ + + +
+ + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.scss new file mode 100644 index 0000000..3b78b91 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.scss @@ -0,0 +1,102 @@ +//@import '../../../assets/scss/var'; + + +//common +h4{margin-top: 16px;} +.s-order-Dashtest-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + overflow: auto; +// overflow-x: hidden; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + max-width: 400px auto; + overflow: auto; + max-height: 300px auto; + + + } +} +#word{ + // width: 270px; + width:500px; +} +.center{ + text-align: center; + font-weight: 500; +} +.s{ + color: blue; +} + +li{ + list-style-type: none; +} +.progress-bar{ + margin-bottom: 5px; + height: 15px; +} + + +.chart-container { + position: relative; + width: 400px; /* Adjust width as needed */ + height: 300px; /* Adjust height as needed */ +} + +.chart-canvas { + width: 100%; + height: 100%; +} +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + background-color:rgb(255, 255, 255); + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +.center { + text-align: center; +} + + +// .progress-bar { +// margin-bottom: 5px; +// height: 15px; +// border: 1px solid #ccc; /* Optional: Add a border to the progress bar */ +// } + +// .progress-meter { +// height: 100%; +// background-color: #007bff; /* Set the background color of the progress bar */ +// color: #fff; /* Set the text color of the percentage */ +// text-align: center; +// line-height: 15px; +// } + +// .progress-text { +// position: absolute; +// top: 0; +// left: 0; +// width: 100%; +// height: 100%; +// display: flex; +// align-items: center; +// justify-content: center; +// } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.spec.ts new file mode 100644 index 0000000..4bf541a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BarRunnerComponent } from './bar-runner.component'; + +describe('BarRunnerComponent', () => { + let component: BarRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BarRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BarRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.ts new file mode 100644 index 0000000..2781144 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component.ts @@ -0,0 +1,101 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { DashrunnerService } from '../dashrunner.service'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; + +@Component({ + selector: 'app-bar-runner', + templateUrl: './bar-runner.component.html', + styleUrls: ['./bar-runner.component.scss'] +}) +export class BarRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + editId; + public DashtestboardArray: DashboardContentModel[] = [ + ]; + workflowLine; + TableName; + XAxis; + YAxis; + showlabel; + lineChartNoLabels:any[] = []; + JsonData; + + barData; + constructor(private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router,) { } + + barChartLabels: any[] = []; + barChartType: string = 'bar'; + barChartLegend = false; + barChartPlugins = []; + barChartData: any[] = []; + + CharData = { + "barChartData": [ + { data: [45, 37, 60, 70, 46, 33], label: 'Best Fruits' }, + ], + "barChartLabels":['Apple', 'Banana', 'Kiwifruit', 'Blueberry', 'Orange', 'Grapes'] + } + + ngOnInit(): void { + this.barChartData = this.CharData.barChartData; + this.barChartLabels = this.CharData.barChartLabels; + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + // this.DashtestboardArray = dash.dashboard; + // console.log(this.DashtestboardArray); + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Bar Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getbarchart(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setbarchart(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + this.showlabel = ChartObject[i].showlabel; + this.barChartLegend = ChartObject[i].chartlegend; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Bar Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.JsonData = Ldata; + this.barChartData = this.JsonData.barChartData; + this.barChartLabels = this.JsonData.barChartLabels; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'barchart.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.html new file mode 100644 index 0000000..c5682e6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.html @@ -0,0 +1,11 @@ +
+
+ + +
+ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.spec.ts new file mode 100644 index 0000000..fdd5925 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BubbleRunnerComponent } from './bubble-runner.component'; + +describe('BubbleRunnerComponent', () => { + let component: BubbleRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BubbleRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BubbleRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.ts new file mode 100644 index 0000000..5bb9632 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component.ts @@ -0,0 +1,140 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ChartConfiguration, ChartDataset, ChartOptions } from 'chart.js'; +// import { Label } from 'ng2-charts'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; +import { DashrunnerService } from '../dashrunner.service'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; + +@Component({ + selector: 'app-bubble-runner', + templateUrl: './bubble-runner.component.html', + styleUrls: ['./bubble-runner.component.scss'] +}) +export class BubbleRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + editId; + public DashtestboardArray: DashboardContentModel[] = [ + ]; + workflowLine; + TableName; + XAxis; + YAxis; + showlabel; + JsonData; + lineChartNoLabels: [] = []; + ChartLegend = false; + + constructor(private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router,) { } + + public bubbleChartOptions: ChartConfiguration['options'] = { + // scales: { + // x: { + // min: 0, + // max: 30, + // ticks: {} + // }, + // y: { + // min: 0, + // max: 30, + // ticks: {} + // }, + // plugins: { + // title: { + // display: true, + // text: 'Bubble Chart' + // } + // } + // } + }; + + public bubbleChartType: string = 'bubble'; + // public bubbleChartLegend = true; + public bubbleChartData: ChartDataset[] = [ + { + data: [ + { x: 10, y: 10, r: 10 }, + { x: 15, y: 5, r: 15 }, + { x: 26, y: 12, r: 23 }, + { x: 7, y: 8, r: 8 }, + ], + label: 'Investment Equities', + backgroundColor: 'rgba(255, 0, 0, 0.6)', // Red + borderColor: 'blue', + hoverBackgroundColor: 'purple', + hoverBorderColor: 'red', + }, + { + data: [ + { x: 5, y: 15, r: 12 }, + { x: 20, y: 7, r: 8 }, + { x: 12, y: 18, r: 15 }, + { x: 8, y: 6, r: 10 }, + ], + label: 'Investment Bonds', + backgroundColor: 'rgba(0, 255, 0, 0.6)', // Green + borderColor: 'green', + hoverBackgroundColor: 'yellow', + hoverBorderColor: 'blue', + }, + ]; + ngOnInit(): void { + // this.pieChartData = this.CharData.pieChartData; + // this.pieChartLabels = this.CharData.pieChartLabels; + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Bubble Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getbubblechart(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setbubblechart(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + this.showlabel = ChartObject[i].showlabel; + this.ChartLegend = ChartObject[i].chartlegend; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Bubble Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.JsonData = Ldata; + this.bubbleChartData = this.JsonData.bubbleChartData; + // this.radarChartLabels = this.JsonData.radarChartLabels; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'bubblechart.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); + } + + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunner.service.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunner.service.spec.ts new file mode 100644 index 0000000..596cd13 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunner.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { DashrunnerService } from './dashrunner.service'; + +describe('DashrunnerService', () => { + let service: DashrunnerService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(DashrunnerService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunner.service.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunner.service.ts new file mode 100644 index 0000000..5c814f6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunner.service.ts @@ -0,0 +1,212 @@ +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from 'src/app/services/api/api-request.service'; +import baseUrl from 'src/app/services/api/helper'; +import { jsPDF } from 'jspdf'; +import domtoimage from 'dom-to-image'; +import { saveAs } from 'file-saver'; + +@Injectable({ + providedIn: 'root' +}) +export class DashrunnerService { + constructor(private apirequest:ApiRequestService,private _http: HttpClient) { } + + + + + getJsonData(api: string, jobType: string): Observable { + const url = `${baseUrl}/fnd/dashboardbuilder/getdashjson/${jobType}`; + let params: HttpParams = new HttpParams(); + params =params.append("api",api); + return this._http.get(url, { params }); + } + + updateDashboardLine(dashName: any, dashboardLine: any): Observable { + return this._http.put(`${baseUrl}/fnd/dashboardbuilder/update_Dashbord_json/${dashName}`, dashboardLine); + } + + getDashboardByName(dashname: any, json: any): Observable { + const params = new HttpParams() + .set('dashname', dashname) + .set('json', json); + + return this._http.get(`${baseUrl}/fnd/dashboardbuilder/get_dashboard`, { params }); + } + + getAxisDetails(): Observable { + return this._http.get(`${baseUrl}/token/Dashboardaxis`); + } + + ////////// + + resetConditions() { + this.lineChartIds = []; // Reset the ids array to an empty array + this.barChartIds = []; + this.doughnutChartIds = []; + this.pieChartIds = []; + this.polarareaChartIds = []; + this.radarChartIds = []; + this.scatterChartIds = []; + this.bubbleChartIds = []; + this.gridviewIds = []; + this.todoIds = []; +} + ////////// Line Chart +lineChartIds: any[] = []; +setlinechart(id: any) { + this.lineChartIds.push(id); +} + +getlinechart(): any[] { + return this.lineChartIds; +} + + ////////// Bar Chart + barChartIds: any[] = []; + setbarchart(id: any) { + this.barChartIds.push(id); + } + + getbarchart(): any[] { + return this.barChartIds; + } + + ////////// Doughnut Chart + doughnutChartIds: any[] = []; + setdoughnutchart(id: any) { + this.doughnutChartIds.push(id); + } + + getdoughnutchart(): any[] { + return this.doughnutChartIds; + } + + ////////// Pie Chart + pieChartIds: any[] = []; + setpiechart(id: any) { + this.pieChartIds.push(id); + } + + getpiechart(): any[] { + return this.pieChartIds; + } + + ////////// Poral Area Chart + polarareaChartIds: any[] = []; + setpolarareachart(id: any) { + this.polarareaChartIds.push(id); + } + + getpolarareachart(): any[] { + return this.polarareaChartIds; + } + + ////////// Radar Chart + radarChartIds: any[] = []; + setradarchart(id: any) { + this.radarChartIds.push(id); + } + + getradarchart(): any[] { + return this.radarChartIds; + } + + ////////// Scatter Chart + scatterChartIds: any[] = []; + setscatterchart(id: any) { + this.scatterChartIds.push(id); + } + + getscatterchart(): any[] { + return this.scatterChartIds; + } + + ////////// Bubble Chart + bubbleChartIds: any[] = []; + setbubblechart(id: any) { + this.bubbleChartIds.push(id); + } + + getbubblechart(): any[] { + return this.bubbleChartIds; + } + ////////// Grid View + gridviewIds: any[] = []; + setgridview(id: any) { + this.gridviewIds.push(id); + } + + getgridview(): any[] { + return this.gridviewIds; + } + ////////// To do + todoIds: any[] = []; + settodo(id: any) { + this.todoIds.push(id); + } + + gettodo(): any[] { + return this.todoIds; + } + + + + //////////////////////////////////////////////////////////////// + + public getChartData(tableName: string, jobType: string, xAxis:any,yAxes:any ): Observable { + const url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&xAxis=${xAxis}&yAxes=${yAxes}`; + return this._http.get(url); + } + + + + ////////////////////////////////////////////// + + async generatePDF(content: HTMLElement, filename: string) { + // Wait for the charts to render (adjust the delay as needed) + await new Promise((resolve) => setTimeout(resolve, 1000)); + + try { + // Convert the content to a data URL + const dataUrl = await domtoimage.toPng(content); + + // Convert data URL to image + const img = new Image(); + img.src = dataUrl; + + img.onload = () => { + const pdf = new jsPDF(); + const imgWidth = 210; // A4 size (width in mm) + const imgHeight = (img.height * imgWidth) / img.width; + + // Add the image to the PDF + pdf.addImage(img, 'PNG', 0, 0, imgWidth, imgHeight); + + // Save the PDF with the custom filename + pdf.save(filename); + }; + } catch (error) { + console.error('Error generating PDF:', error); + } + } + + // async generatePDF(content: HTMLElement, filename: string) { + // await new Promise((resolve) => setTimeout(resolve, 1000)); + + // try { + // // Convert the content to a data URL + // const dataUrl = await domtoimage.toPng(content); + + // // Send a request to the server to generate the PDF + // const pdfData = await this._http.post('/api/generate-pdf', { dataUrl, filename }).toPromise(); + + // // Save the PDF on the client-side + // saveAs(pdfData, filename); + // } catch (error) { + // console.error('Error generating PDF:', error); + // } + // } + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.html new file mode 100644 index 0000000..4a68f73 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.html @@ -0,0 +1,40 @@ +
+ + +
+
+
+ + + + + + + + +

{{ item.charttitle }}

+
+ + + + +
+
+
+
+ +
+ + +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.scss new file mode 100644 index 0000000..66f63a6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.scss @@ -0,0 +1,49 @@ +.componentbtn{ + color: white; + background-color: #03AC13; + border: none; +} +.content-container { + min-height: 100vh; + height: initial; +} +a:hover { +text-decoration: none; +cursor: pointer; +} +.clr-checkbox{ +color: #212529; +border: 1px solid #ced4da; +border-radius: 0.25rem; +// padding: 0.75rem 0.75rem; +// margin-top: 3px; +width: 100%; +margin-left: 20px; +margin-bottom: 18px; +} +.clr-input, .clr-dropdown { +color: #212529; +border: 1px solid #ced4da; +border-radius: 0.25rem; +padding: 0.75rem 0.75rem; +margin-top: 3px; +width: 100%; +margin-bottom: 10px; +} + +.circle { + width: 25px; + height: 25px; + border: 0.5px solid black; + border-radius: 25px; + // background-color: #235255; + display: flex; + align-items: center; + justify-content: center; + opacity: 0.4; +} +.circle b, clr-icon { + // color: #fff; + font-size: 15px; + //opacity: 0.5; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.spec.ts new file mode 100644 index 0000000..dc29447 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashrunnerlineComponent } from './dashrunnerline.component'; + +describe('DashrunnerlineComponent', () => { + let component: DashrunnerlineComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DashrunnerlineComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DashrunnerlineComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.ts new file mode 100644 index 0000000..61f9a3c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/dashrunnerline.component.ts @@ -0,0 +1,291 @@ +import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; +import { ChartDataset, ChartType } from 'chart.js'; +import { DashrunnerService } from './dashrunner.service'; +import { GridsterConfig, GridsterItem, GridsterItemComponentInterface } from 'angular-gridster2'; +import { DoughnutRunnerComponent } from './doughnut-runner/doughnut-runner.component'; +import { LineRunnerComponent } from './line-runner/line-runner.component'; +import { BarRunnerComponent } from './bar-runner/bar-runner.component'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; +import { GridRunnerComponent } from './grid-runner/grid-runner.component'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; +import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; +import { TodoRunnerComponent } from './todo-runner/todo-runner.component'; +import { jsPDF } from 'jspdf'; +import domtoimage from 'dom-to-image'; +import { PieRunnerComponent } from './pie-runner/pie-runner.component'; +import { BubbleRunnerComponent } from './bubble-runner/bubble-runner.component'; +import { ScatterRunnerComponent } from './scatter-runner/scatter-runner.component'; +import { PolarRunnerComponent } from './polar-runner/polar-runner.component'; +import { RadarRunnerComponent } from './radar-runner/radar-runner.component'; + +@Component({ + selector: 'app-dashrunnerline', + templateUrl: './dashrunnerline.component.html', + styleUrls: ['./dashrunnerline.component.scss'] +}) +export class DashrunnerlineComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + // @ViewChild('contentContainer', {static:false}) el!: ElementRef; + public options: GridsterConfig; + workflowLine:any; + editId; + public DashtestboardArray: DashboardContentModel[] = [ + + + ]; + componentCollection = [ + { name: "Line Chart", componentInstance: LineRunnerComponent }, + { name: "Doughnut Chart", componentInstance: DoughnutRunnerComponent }, + { name: "Bar Chart", componentInstance: BarRunnerComponent }, + { name: "Pie Chart", componentInstance: PieRunnerComponent }, + { name: "Bubble Chart", componentInstance: BubbleRunnerComponent }, + { name: "Scatter Chart", componentInstance: ScatterRunnerComponent }, + { name: "Polar Area Chart", componentInstance: PolarRunnerComponent }, + { name: "Radar Chart", componentInstance: RadarRunnerComponent }, + { name: "Grid View", componentInstance: GridRunnerComponent }, + { name: "To Do Chart", componentInstance: TodoRunnerComponent }, +]; + + constructor(private Dashtestservive:DashrunnerService, private dashboardService: Dashboard3Service,private route: ActivatedRoute, + private router : Router,) { } + + ngOnInit(): void { + + + this.router.events.subscribe((event) => { + if (event instanceof NavigationEnd) { + // Reset conditions when navigation changes + this.Dashtestservive.resetConditions(); + } + }); + + this.options = { + gridType: 'fit', + enableEmptyCellDrop: true, + pushItems: true, + swap: true, + pushDirections: { north: true, east: true, south: true, west: true }, + resizable: { enabled: true }, + draggable: { + enabled: true, + ignoreContent: true, + dropOverItems: true, + dragHandleClass: 'drag-handler', + ignoreContentClass: 'no-drag', + }, + displayGrid: 'onDrag&Resize', //always + minCols: 10, + minRows: 10, + }; + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + this.getbyId(this.editId); + } +//getbyname +dashboard_name = "Dashtest"; + getbyId(id){ + this.dashboardService.getById(id).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + this.dashboard_name = data.dashboard_name; + if(this.workflowLine == "" || this.workflowLine == null){ + console.log("default json"); + const defaultJson = [ + { + cols: 3, + rows: 5, + x: 0, + y: 0, + chartid: 3, + name: 'Doughnut Chart', + component: 'Doughnut Chart', + }, + { + cols: 3, + rows: 5, + x: 0, + y: 0, + chartid: 3, + name: 'Line Chart', + component: 'Line Chart', + }, + { + cols: 3, + rows: 5, + x: 0, + y: 0, + chartid: 3, + name: 'Bar Chart', + component: 'Bar Chart', + }, + { + cols: 3, + rows: 5, + x: 0, + y: 0, + chartid: 3, + name: 'Grid View', + component: 'Grid View', + }, + { + cols: 3, + rows: 5, + x: 0, + y: 0, + chartid: 3, + name: 'To Do Chart', + component: 'To Do Chart', + } + ] + this.workflowLine = JSON.stringify(defaultJson); + } + console.log(this.workflowLine); + if(this.workflowLine) + { + console.log(this.workflowLine); + const dash = JSON.parse(this.workflowLine) ; + this.DashtestboardArray = dash.dashboard; + console.log(this.DashtestboardArray); + this.parseJson(this.DashtestboardArray); + } + + },(error)=>{ + console.log(error); + }); + } + + parseJson(DashtestboardArray: any) { + DashtestboardArray.forEach(dashboard => { + this.componentCollection.forEach(component => { + if (dashboard.component === component.name) { + dashboard.component = component.componentInstance; + } + }); + }); + } + + + dashbord1_Line = { + model:'' + } + + update(){ + console.log(this.DashtestboardArray); + + let cmp=this.DashtestboardArray.forEach(dashboard=>{ + this.componentCollection.forEach(component=>{ + if (dashboard.name === component.name) { + dashboard.component = component.name; + } }) + }) + + console.log(cmp); + + let tmp = JSON.stringify(this.DashtestboardArray); + this.dashbord1_Line.model = tmp; + + this.Dashtestservive.updateDashboardLine(this.dashboard_name, this.dashbord1_Line).subscribe((data)=>{ + console.log(data); + }); + + window.location.reload(); + // this.parseJson(this.DashtestboardArray); + } + + + //Resizabel and drag + resizable: boolean = false; + toggleResizable() { + this.resizable = !this.resizable; + if (this.resizable == true) { + this.options = { + resizable: { enabled: false }, + }; + } else { + this.options = { + resizable: { enabled: true }, + }; + } + } + + // generatePDF(){ + // let pdf = new jsPDF('p','pt','a4'); + // pdf.html(this.el.nativeElement,{ + // callback: (pdf)=>{ + // pdf.save("demo.pdf"); + // } + // }) + // } + + + // async generatePDF() { + // const content = this.contentContainerRef.nativeElement; + + // // Wait for the charts to render (adjust the delay as needed) + // await new Promise((resolve) => setTimeout(resolve, 1000)); + + // try { + // // Convert the content to canvas (using html2canvas) + // const canvas = await html2canvas(content); + + // const pdf = new html2pdf.default(); + // const options = { + // margin: 10, + // filename: 'dashboard.pdf', + // image: { type: 'jpeg', quality: 0.98 }, + // jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } + // }; + + // // Convert the canvas to PDF and save + // await pdf.from(canvas).set(options).outputPdf().then((pdfOutput: any) => { + // // Convert the PDF output to a Blob + // const pdfBlob = new Blob([pdfOutput], { type: 'application/pdf' }); + + // // Save the Blob as a file using FileSaver.js + // saveAs(pdfBlob, 'dashboard.pdf'); + // }); + // } catch (error) { + // console.error('Error generating PDF:', error); + // } + // } + + async generatePDF() { + const content = this.contentContainerRef.nativeElement; + + // Wait for the charts to render (adjust the delay as needed) + await new Promise((resolve) => setTimeout(resolve, 1000)); + + try { + // Convert the content to a data URL (using dom-to-image) + const dataUrl = await domtoimage.toPng(content); + + // Convert data URL to image + const img = new Image(); + img.src = dataUrl; + + img.onload = () => { + const pdf = new jsPDF(); + const imgWidth = 210; // A4 size (width in mm) + const imgHeight = (img.height * imgWidth) / img.width; + + // Add the image to the PDF + pdf.addImage(img, 'PNG', 0, 0, imgWidth, imgHeight); + // pdf.save('dashboard.pdf'); + const pdfName = this.dashboard_name + '.pdf' + pdf.save(pdfName) + }; + } catch (error) { + console.error('Error generating PDF:', error); + } + } + + // Export(name){ + // console.log(name); + // this.dashboardService.setName(name); + // } + + onButtonClicked(): void { + console.log('Button clicked in SomeComponent'); + // Add your custom logic here when the button is clicked in SomeComponent + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.html new file mode 100644 index 0000000..5dd1f44 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.html @@ -0,0 +1,10 @@ +
+
+ + +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.scss new file mode 100644 index 0000000..ac9ae54 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.scss @@ -0,0 +1,76 @@ +//@import '../../../assets/scss/var'; + + +//common +h4{margin-top: 16px;} +.s-order-Dashtest-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + overflow: auto; +// overflow-x: hidden; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + max-width: 400px auto; + overflow: auto; + max-height: 300px auto; + + + } +} +#word{ + // width: 270px; + width:500px; +} +.center{ + text-align: center; + font-weight: 500; +} +.s{ + color: blue; +} + +li{ + list-style-type: none; +} +.progress-bar{ + margin-bottom: 5px; + height: 15px; +} + + +.chart-container { + position: relative; + width: 400px; /* Adjust width as needed */ + height: 300px; /* Adjust height as needed */ +} + +.chart-canvas { + width: 100%; + height: 100%; +} +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + background-color:rgb(255, 255, 255); + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +.center { + text-align: center; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.spec.ts new file mode 100644 index 0000000..46fa1b6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DoughnutRunnerComponent } from './doughnut-runner.component'; + +describe('DoughnutRunnerComponent', () => { + let component: DoughnutRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DoughnutRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DoughnutRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.ts new file mode 100644 index 0000000..f92400c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component.ts @@ -0,0 +1,99 @@ +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { DashrunnerService } from '../dashrunner.service'; +import {baseColors } from 'ng2-charts'; +import { ChartDataset, ChartType, } from 'chart.js'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; + +@Component({ + selector: 'app-doughnut-runner', + templateUrl: './doughnut-runner.component.html', + styleUrls: ['./doughnut-runner.component.scss'] +}) +export class DoughnutRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + editId; + public DashtestboardArray: DashboardContentModel[] = [ + ]; + workflowLine; + TableName; + XAxis; + YAxis; + showlabel; + lineChartNoLabels:any[] = []; + JsonData; + + doughnutD; + doughnutChartData:any = []; + doughnutChartLabels: any[] = []; + doughnutChartLegend = false; + doughnutData ={ + "chartData": [[55, 25, 20]], + "chartLabels": ["Project", "Repository", "Wireframe"] + } + doughnutChartType: ChartType = 'doughnut'; + + + constructor(private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router,) { } + ngOnInit(): void { + this.doughnutChartData = this.doughnutData.chartData; + this.doughnutChartLabels = this.doughnutData.chartLabels; + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + // this.DashtestboardArray = dash.dashboard; + // console.log(this.DashtestboardArray); + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Doughnut Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getdoughnutchart(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setdoughnutchart(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + this.showlabel = ChartObject[i].showlabel; + this.doughnutChartLegend = ChartObject[i].chartlegend; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Doughnut Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.JsonData = Ldata; + this.doughnutChartData = this.JsonData.chartData; + this.doughnutChartLabels = this.JsonData.chartLabels; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + generatePDFFile(){ + // this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'doughnut.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); + } + + + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.html new file mode 100644 index 0000000..4761acc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.html @@ -0,0 +1,54 @@ + +
+
+ + + + + + + + + + + +
{{co}}
{{item[key]}}
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.scss new file mode 100644 index 0000000..bbed2c9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.scss @@ -0,0 +1,12 @@ +input.ng-invalid.ng-touched { + border-color: red; + } + + .error_mess { + color: red; + } + clr-datagrid{ + height: 400px; /* Adjust the height as needed */ + overflow-y: auto; + + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.spec.ts new file mode 100644 index 0000000..57bca9f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GridRunnerComponent } from './grid-runner.component'; + +describe('GridRunnerComponent', () => { + let component: GridRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ GridRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(GridRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.ts new file mode 100644 index 0000000..9e1f6ac --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component.ts @@ -0,0 +1,111 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { DashrunnerService } from '../dashrunner.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; + +@Component({ + selector: 'app-grid-runner', + templateUrl: './grid-runner.component.html', + styleUrls: ['./grid-runner.component.scss'] +}) +export class GridRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + loading = false; + givendata; + error; + XAxis; + YAxis; + + rows:any[]; + columns: any[]; + rowdata; + + editId; + public DashtestboardArray: DashboardContentModel[] = []; + workflowLine; + TableName; + + constructor( + private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router + ) { } + + ngOnInit(): void { + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + // this.getbyId(); + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + // this.DashtestboardArray = dash.dashboard; + // console.log(this.DashtestboardArray); + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Grid View"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getgridview(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setgridview(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Grid View",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.rows = Ldata; + this.rowdata = this.rows + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + + +//dynamic table + + +getTableData(id){ +} +getHeaders() { +let headers: string[] = []; +if(this.rows) { + this.rows.forEach((value) => { + Object.keys(value).forEach((key) => { + if(!headers.find((header) => header == key)){ + headers.push(key) + } + + }) + + }) +} +return headers; +} + +generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'gridview.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); +} +} + diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.html new file mode 100644 index 0000000..5f5da80 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.html @@ -0,0 +1,14 @@ +
+
+ + + +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.scss new file mode 100644 index 0000000..ac9ae54 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.scss @@ -0,0 +1,76 @@ +//@import '../../../assets/scss/var'; + + +//common +h4{margin-top: 16px;} +.s-order-Dashtest-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + overflow: auto; +// overflow-x: hidden; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + max-width: 400px auto; + overflow: auto; + max-height: 300px auto; + + + } +} +#word{ + // width: 270px; + width:500px; +} +.center{ + text-align: center; + font-weight: 500; +} +.s{ + color: blue; +} + +li{ + list-style-type: none; +} +.progress-bar{ + margin-bottom: 5px; + height: 15px; +} + + +.chart-container { + position: relative; + width: 400px; /* Adjust width as needed */ + height: 300px; /* Adjust height as needed */ +} + +.chart-canvas { + width: 100%; + height: 100%; +} +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + background-color:rgb(255, 255, 255); + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +.center { + text-align: center; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.spec.ts new file mode 100644 index 0000000..7785dba --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LineRunnerComponent } from './line-runner.component'; + +describe('LineRunnerComponent', () => { + let component: LineRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ LineRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(LineRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.ts new file mode 100644 index 0000000..93d621b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component.ts @@ -0,0 +1,169 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { baseColors } from 'ng2-charts'; +import { ChartDataset, ChartType } from 'chart.js'; +import { DashrunnerService } from '../dashrunner.service'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; +import { jsPDF } from 'jspdf'; +import domtoimage from 'dom-to-image'; +@Component({ + selector: 'app-line-runner', + templateUrl: './line-runner.component.html', + styleUrls: ['./line-runner.component.scss'] +}) +export class LineRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + editId; + public DashtestboardArray: DashboardContentModel[] = [ + ]; + workflowLine; + TableName; + XAxis; + YAxis; + showlabel; + + JsonData; + lineChartData: ChartDataset[] = []; + lineChartLabels:any[] = []; + lineChartNoLabels: any[] = []; + lineCharData = + { + "chartData": [ + { "data": [85, 72, 78, 75, 77, 75, 43,85, 72, 78, 75, 77, 75, 43], "label": "Test Projects" } + ], + "chartLabels": ["Jan", "Feb", "March", "April", "May", "June","july","Jan", "Feb", "March", "April", "May", "June","july"] + } + + lineChartOptions = { + // plugins: { + // colors: { + // forceOverride: true + // } + // }, + responsive: true, + }; + lineChartColors:any[] = [ + { + borderColor: 'black', + backgroundColor: 'rgba(255,255,0,0.28)', + }, + ]; + + lineChartLegend = false; + lineChartPlugins = []; + lineChartType = 'line'; + constructor(private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router,) { } + + ngOnInit(): void { + + this.lineChartData = this.lineCharData.chartData; + this.lineChartLabels = this.lineCharData.chartLabels; + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + // this.DashtestboardArray = dash.dashboard; + // console.log(this.DashtestboardArray); + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Line Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getlinechart(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setlinechart(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + this.showlabel = ChartObject[i].showlabel; + this.lineChartLegend = ChartObject[i].chartlegend; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Line Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.JsonData = Ldata; + this.lineChartData = this.JsonData.chartData; + this.lineChartLabels = this.JsonData.chartLabels; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + + // setTimeout(() => { + // // this.Dashtestservive.getJsonData("http://localhost:9292/token/Dashboardaxis/7","Line Chart").subscribe(Ldata => { + // this.Dashtestservive.getChartData(this.TableName,"Line Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + // console.log(Ldata); + // this.JsonData = Ldata; + // this.lineChartData = this.JsonData.chartData; + // this.lineChartLabels = this.JsonData.chartLabels; + + // },(error) => { + // console.log(error); + // }); + + // }, 500); + + // const name = this.dashboardService.getName() + // // Here, you can execute the method based on the received name + // if (name === 'Line Chart') { + // this.generatePDF(); + // } + } + + generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'linechart.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); + } + + // async generatePDF() { + // const content = this.contentContainerRef.nativeElement; + + // // Wait for the charts to render (adjust the delay as needed) + // await new Promise((resolve) => setTimeout(resolve, 1000)); + + // try { + // // Convert the content to a data URL (using dom-to-image) + // const dataUrl = await domtoimage.toPng(content); + + // // Convert data URL to image + // const img = new Image(); + // img.src = dataUrl; + + // img.onload = () => { + // const pdf = new jsPDF(); + // const imgWidth = 210; // A4 size (width in mm) + // const imgHeight = (img.height * imgWidth) / img.width; + + // // Add the image to the PDF + // pdf.addImage(img, 'PNG', 0, 0, imgWidth, imgHeight); + // pdf.save('linechart.pdf'); + // // const pdfName = this.dashboard_name + '.pdf' + // // pdf.save(pdfName) + // }; + // } catch (error) { + // console.error('Error generating PDF:', error); + // } + // } + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.html new file mode 100644 index 0000000..59cb87b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.html @@ -0,0 +1,11 @@ +
+
+ + + +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.spec.ts new file mode 100644 index 0000000..8384566 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PieRunnerComponent } from './pie-runner.component'; + +describe('PieRunnerComponent', () => { + let component: PieRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PieRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PieRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.ts new file mode 100644 index 0000000..c1a64d1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component.ts @@ -0,0 +1,92 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { DashrunnerService } from '../dashrunner.service'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; + + +@Component({ + selector: 'app-pie-runner', + templateUrl: './pie-runner.component.html', + styleUrls: ['./pie-runner.component.scss'] +}) +export class PieRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + editId; + public DashtestboardArray: DashboardContentModel[] = [ + ]; + workflowLine; + TableName; + XAxis; + YAxis; + showlabel; + JsonData; + lineChartNoLabels: any[] = []; + + constructor(private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router,) { } + + public pieChartLabels: string[] = ['SciFi', 'Drama', 'Comedy']; + public pieChartData: number[] = [30, 50, 20]; + public pieChartType: string = 'pie'; + ChartLegend = false; + + ngOnInit(): void { + // this.pieChartData = this.CharData.pieChartData; + // this.pieChartLabels = this.CharData.pieChartLabels; + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + // this.DashtestboardArray = dash.dashboard; + // console.log(this.DashtestboardArray); + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Pie Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getpiechart(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setpiechart(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + this.showlabel = ChartObject[i].showlabel; + this.ChartLegend = ChartObject[i].chartlegend; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Pie Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.JsonData = Ldata; + this.pieChartData = this.JsonData.pieChartData; + this.pieChartLabels = this.JsonData.pieChartLabels; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'piechart.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.html new file mode 100644 index 0000000..34754a6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.html @@ -0,0 +1,10 @@ +
+
+ + +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.spec.ts new file mode 100644 index 0000000..5f95ce3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PolarRunnerComponent } from './polar-runner.component'; + +describe('PolarRunnerComponent', () => { + let component: PolarRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PolarRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PolarRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.ts new file mode 100644 index 0000000..fdbe17a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component.ts @@ -0,0 +1,93 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { DashrunnerService } from '../dashrunner.service'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; +// import { Label } from 'ng2-charts'; + +@Component({ + selector: 'app-polar-runner', + templateUrl: './polar-runner.component.html', + styleUrls: ['./polar-runner.component.scss'] +}) +export class PolarRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + editId; + public DashtestboardArray: DashboardContentModel[] = [ + ]; + workflowLine; + TableName; + XAxis; + YAxis; + showlabel; + JsonData; + lineChartNoLabels: any[] = []; + + constructor(private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router,) { } + + public polarAreaChartLabels: string[] = [ 'Download Sales', 'In-Store Sales', 'Mail Sales', 'Telesales', 'Corporate Sales' ]; + public polarAreaChartData: any = [ + { data: [ 300, 500, 100, 40, 120 ], label: 'Series 1'} + ]; + + public polarAreaChartType: string = 'polarArea'; + ChartLegend = false; + ngOnInit(): void { + // this.pieChartData = this.CharData.pieChartData; + // this.pieChartLabels = this.CharData.pieChartLabels; + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Polar Area Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getpolarareachart(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setpolarareachart(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + this.showlabel = ChartObject[i].showlabel; + this.ChartLegend = ChartObject[i].chartlegend; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"PolarArea Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.JsonData = Ldata; + this.polarAreaChartData = this.JsonData.polarAreaChartData; + this.polarAreaChartLabels = this.JsonData.polarAreaChartLabels; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'polarareachart.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.html new file mode 100644 index 0000000..009d6b5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.html @@ -0,0 +1,10 @@ +
+
+ + +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.spec.ts new file mode 100644 index 0000000..d461a81 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RadarRunnerComponent } from './radar-runner.component'; + +describe('RadarRunnerComponent', () => { + let component: RadarRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ RadarRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(RadarRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.ts new file mode 100644 index 0000000..e1a901e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component.ts @@ -0,0 +1,102 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { DashrunnerService } from '../dashrunner.service'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; +// import { Label } from 'ng2-charts'; + +@Component({ + selector: 'app-radar-runner', + templateUrl: './radar-runner.component.html', + styleUrls: ['./radar-runner.component.scss'] +}) +export class RadarRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + editId; + public DashtestboardArray: DashboardContentModel[] = [ + ]; + workflowLine; + TableName; + XAxis; + YAxis; + showlabel; + JsonData; + lineChartNoLabels: any[] = []; + ChartLegend = false; + + constructor(private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router,) { } + + public radarChartLabels: string[] = [ + "Eating", + "Drinking", + "Sleeping", + "Designing", + "Coding", + "Cycling", + "Running" + ]; + + public radarChartData: any = [ + { data: [65, 59, 90, 81, 56, 55, 40], label: "Series A" }, + { data: [28, 48, 40, 19, 96, 27, 100], label: "Series B" } + ]; + public radarChartType: string = "radar"; + ngOnInit(): void { + // this.pieChartData = this.CharData.pieChartData; + // this.pieChartLabels = this.CharData.pieChartLabels; + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Radar Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getradarchart(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setradarchart(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + this.showlabel = ChartObject[i].showlabel; + this.ChartLegend = ChartObject[i].chartlegend; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Radar Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.JsonData = Ldata; + this.radarChartData = this.JsonData.radarChartData; + this.radarChartLabels = this.JsonData.radarChartLabels; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'radarchart.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.html new file mode 100644 index 0000000..5229e6b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.html @@ -0,0 +1,12 @@ +
+
+ + +
+ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.spec.ts new file mode 100644 index 0000000..67dde75 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ScatterRunnerComponent } from './scatter-runner.component'; + +describe('ScatterRunnerComponent', () => { + let component: ScatterRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ScatterRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ScatterRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.ts new file mode 100644 index 0000000..2f36596 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component.ts @@ -0,0 +1,121 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { DashrunnerService } from '../dashrunner.service'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; +// import { Label } from 'ng2-charts'; +import { ChartDataset } from 'chart.js'; + +@Component({ + selector: 'app-scatter-runner', + templateUrl: './scatter-runner.component.html', + styleUrls: ['./scatter-runner.component.scss'] +}) +export class ScatterRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + editId; + public DashtestboardArray: DashboardContentModel[] = [ + ]; + workflowLine; + TableName; + XAxis; + YAxis; + showlabel; + JsonData; + lineChartNoLabels: any[] = []; + ChartLegend = false; + + constructor(private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router,) { } + + public scatterChartLabels: string[] = [ 'Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running' ]; + + public scatterChartData: ChartDataset[] = [ + { + data: [ + { x: 1, y: 1 }, + { x: 2, y: 3 }, + { x: 3, y: -2 }, + { x: 4, y: 4 }, + { x: 5, y: -3, r: 20 }, + ], + label: 'Series A', // This label will be displayed on hover + pointRadius: 10, + backgroundColor: 'red', + }, + { + data: [ + { x: 2, y: 2 }, + { x: 3, y: 4 }, + { x: 4, y: -1 }, + { x: 5, y: 5 }, + { x: 6, y: -2, r: 20 }, + ], + label: 'Series B', // This label will be displayed on hover + pointRadius: 10, + backgroundColor: 'blue', + }, + ]; + public scatterChartType: string = 'scatter'; + ChartOptions = { + aspectRatio:2.5, + responsive: true, + }; + ngOnInit(): void { + // this.pieChartData = this.CharData.pieChartData; + // this.pieChartLabels = this.CharData.pieChartLabels; + + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + + const ChartObject = dash.dashboard.filter(obj => obj.name === "Scatter Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.getscatterchart(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.setscatterchart(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + this.showlabel = ChartObject[i].showlabel; + this.ChartLegend = ChartObject[i].chartlegend; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Scatter Chart",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.JsonData = Ldata; + this.scatterChartData = this.JsonData.scatterChartData; + this.scatterChartLabels = this.JsonData.scatterChartLabels; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'scatterchart.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.html new file mode 100644 index 0000000..139a1d5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.html @@ -0,0 +1,30 @@ +
+
+ + + + + + + + + + + + + + + + +
#{{todoList.listName}}
{{i + 1}}{{todo}} + + + +
+ + + + + +
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.spec.ts new file mode 100644 index 0000000..3ac8ed3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TodoRunnerComponent } from './todo-runner.component'; + +describe('TodoRunnerComponent', () => { + let component: TodoRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ TodoRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(TodoRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.ts new file mode 100644 index 0000000..cb264cb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component.ts @@ -0,0 +1,103 @@ +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { DashrunnerService } from '../dashrunner.service'; +import { DashboardContentModel } from 'src/app/models/builder/dashboard'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; + +@Component({ + selector: 'app-todo-runner', + templateUrl: './todo-runner.component.html', + styleUrls: ['./todo-runner.component.scss'] +}) +export class TodoRunnerComponent implements OnInit { + @ViewChild('contentContainer') contentContainerRef!: ElementRef; + @Output() buttonClicked = new EventEmitter(); + constructor( private Dashtestservive:DashrunnerService,private route: ActivatedRoute,private dashboardService: Dashboard3Service, + private router : Router) { } + + loading = false; + givendata; + error; + XAxis; + YAxis; + + editId; + public DashtestboardArray: DashboardContentModel[] = []; + workflowLine; + TableName; + + list; + data: any; + todo: string = ''; + // todoList = ['todo 1']; + todoList = { + listName: "title123", + List:['todo 1','todo 2'], + } + ngOnInit(): void { + this.editId = this.route.snapshot.params.id; + console.log(this.editId); + // this.getbyId(); + + this.dashboardService.getById(this.editId).subscribe((data)=>{ + console.log(data); + this.workflowLine = data.dashbord1_Line[0].model; + const dash = JSON.parse(this.workflowLine) ; + // this.DashtestboardArray = dash.dashboard; + // console.log(this.DashtestboardArray); + + const ChartObject = dash.dashboard.filter(obj => obj.name === "To Do Chart"); + console.log(ChartObject); + for (let i = 0; i < ChartObject.length; i++) { + const ids = this.Dashtestservive.gettodo(); + // console.log(ids); + if (ids.includes(ChartObject[i].chartid)) { + // If the chartid is already in the ids array, continue to the next iteration + continue; + } + this.Dashtestservive.settodo(ChartObject[i].chartid); + const id = ids[i]; + console.log(id); + + if (ChartObject[i].chartid === id) { + this.TableName = ChartObject[i].table; + this.XAxis = ChartObject[i].xAxis; + this.YAxis = ChartObject[i].yAxis; + console.log(this.TableName); + this.Dashtestservive.getChartData(this.TableName,"Todo List",this.XAxis,this.YAxis).subscribe((Ldata) => { + console.log(Ldata); + this.todoList.listName = Ldata.listName; + this.todoList.List = Ldata.List; + + },(error) => { + console.log(error); + }); + break; // No need to continue the loop once the correct placeholder is found + } + } + }); + } + + + + + + public addTodo(todo: string) { + this.todoList.List.push(todo); + this.todo = ''; // Clear the input field after adding a todo +} + +public removeTodo(todoIx: number) { + if (this.todoList.List.length) { + this.todoList.List.splice(todoIx, 1); + } +} + +generatePDFFile(){ + this.buttonClicked.emit(); + const content = this.contentContainerRef.nativeElement; + const filename = 'Todolist.pdf'; // You can provide any desired filename here + + this.Dashtestservive.generatePDF(content, filename); +} +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/FileUploadList.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/FileUploadList.component.ts new file mode 100644 index 0000000..c2c2a45 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/FileUploadList.component.ts @@ -0,0 +1,23 @@ +// import { Component, Input, Output, EventEmitter } from '@angular/core'; + +// @Component({ +// selector: 'app-file-upload-list', +// templateUrl: './file-upload-list.component.html', +// }) +// export class FileUploadListComponent { +// @Input() fileData: any[] = []; +// @Input() type: 'image' | 'audio' | 'video' | 'document' = 'image'; +// @Output() fileChanged = new EventEmitter<{ event: any, index: number }>(); +// @Output() deleteRow = new EventEmitter(); +// @Output() addRow = new EventEmitter(); + +// get acceptType() { +// switch (this.type) { +// case 'image': return 'image/*'; +// case 'audio': return 'audio/*'; +// case 'video': return 'video/*'; +// case 'document': return 'application/pdf,.csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel'; +// default: return '*/*'; +// } +// } +// } diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/file-upload-list.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/file-upload-list.component.html new file mode 100644 index 0000000..2fe6e1b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/fileUpload/file-upload-list.component.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.css new file mode 100644 index 0000000..a3722b6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=report-build.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.css.map new file mode 100644 index 0000000..c4b7c9a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"report-build.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.spec.ts new file mode 100644 index 0000000..da80cc9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportBuildComponent } from './report-build.component'; + +describe('ReportBuildComponent', () => { + let component: ReportBuildComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportBuildComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportBuildComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.ts new file mode 100644 index 0000000..0583dca --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/report-build.component.ts @@ -0,0 +1,14 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-report-build', + templateUrl: './report-build.component.html', + styleUrls: ['./report-build.component.scss'] +}) +export class ReportBuildComponent implements OnInit { + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.css new file mode 100644 index 0000000..5a8298a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.css @@ -0,0 +1,75 @@ +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; +} +.s-info-bar button { + outline: none; +} + +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} + +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + font-weight: bold; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} + +input[type=text], [type=date], textarea { + width: 100%; + padding: 15px 15px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.required-field { + color: red; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +}/*# sourceMappingURL=reportbuildadd.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.css.map new file mode 100644 index 0000000..002810c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["reportbuildadd.component.scss","reportbuildadd.component.css"],"names":[],"mappings":"AACA;EACI,aAAA;EACA,mBAAA;EACA,8BAAA;ACAJ;ADCI;EACE,aAAA;ACCN;;ADGE;EACE,YAAA;ACAJ;;ADGE;EACE,aAAA;ACAJ;;ADEE;EACE,mBAAA;ACCJ;;ADIE;EACE,yBAHS;EAIT,YAAA;ACDJ;;ADIE;EAEE,iBAAA;EACA,aAAA;EACA,eAAA;ACFJ;;ADKE;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACFJ;;ADKE;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EAEA,eAAA;EACA,WAAA;EACA,mBAAA;ACHJ;;ADME;EACE,kBAAA;ACHJ;;ADKE;EACE,WAAA;EACA,kBAAA;EAED,oCAAA;EACC,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACHJ;;ADME;EACE,UAAA;ACHJ;;ADME;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACHJ","file":"reportbuildadd.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.html new file mode 100644 index 0000000..60df2d0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.html @@ -0,0 +1,48 @@ +

{{ 'CREATE_NEW_REPORT' | translate }}

+ {{ 'ADD_MODE' | translate }}
+
+ + + + + + + + +
+ + + + + +
+ +
+
+ + + +
+
+ + +
+
+ + +
+
+ + + +
+
+
+ + +
+
+ +
+
+
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.scss new file mode 100644 index 0000000..39de1cb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.scss @@ -0,0 +1,80 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=date],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.spec.ts new file mode 100644 index 0000000..e94fb3b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportbuildaddComponent } from './reportbuildadd.component'; + +describe('ReportbuildaddComponent', () => { + let component: ReportbuildaddComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportbuildaddComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportbuildaddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.ts new file mode 100644 index 0000000..39929f2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildadd/reportbuildadd.component.ts @@ -0,0 +1,60 @@ +import { HttpErrorResponse, HttpHeaderResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; + +@Component({ + selector: 'app-reportbuildadd', + templateUrl: './reportbuildadd.component.html', + styleUrls: ['./reportbuildadd.component.scss'] +}) +export class ReportbuildaddComponent implements OnInit { + + public entryForm: FormGroup; + constructor(private _fb: FormBuilder, private router: Router,private toastr: ToastrService, + private route: ActivatedRoute,private reportBuilderService: ReportBuilderService) { } + + ngOnInit(): void { + this.entryForm = this._fb.group({ + reportName: [null], + description:[null], + active:[null], + isSql:[true], + Rpt_builder2_lines: this._fb.array([this.initLinesFormReport()]), + }); + + } + + initLinesFormReport() { + return this._fb.group({ + model: '' + }); + } + + toastrShown: boolean = false; + onSubmit(){ + console.log(this.entryForm.value); + this.reportBuilderService.saverbData(this.entryForm.value).subscribe((data)=>{ + console.log(data); + if (data || data.status >= 200 && data.status <= 209) { + this.toastr.success('Report save successfully'); + } + },(error:HttpErrorResponse) => { + console.log(error); + if(error.status==404){ + this.toastr.error(error.error); + } + if(error.status==200){ this.toastr.success('Report save successfully'); } + if(error.status==400){ this.toastr.error('Report Save Unsuccessful'); } + }); + setTimeout(()=>{ + this.router.navigate(["../all"], { relativeTo: this.route }); + },500); + } + goback(){ + this.router.navigate(["../all"], { relativeTo: this.route }); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.css new file mode 100644 index 0000000..720f9da --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.css @@ -0,0 +1,90 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; +} + +.td-content { + text-align: left; +} + +.delete, .heading { + text-align: center; + color: red; +} + +input[type=radio] { + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; +} + +.dots { + width: 100px; + height: 100px; + bordeR: 1px solid; + border-radius: 50%; +} + +h4 { + margin-top: 16px; +} + +.s-order-dash-pg { + margin: 0px; + display: flex; + flex-wrap: wrap; + flex-direction: row; + justify-content: center; +} +.s-order-dash-pg .chart-box { + margin: 16px; + padding: 0 16px; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 2px; +} + +#word1 { + width: 190px; + height: 180px; +} + +.center { + text-align: center; + margin-top: 5px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.heading { + text-align: center; + color: red; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +}/*# sourceMappingURL=reportbuildall.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.css.map new file mode 100644 index 0000000..3cc1526 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["reportbuildall.component.scss","reportbuildall.component.css"],"names":[],"mappings":"AAAA;EACI,iBAAA;EACA,YAAA;EACA,iBAAA;EACA,2CAAA;EACA,YAAA;ACCJ;;ADCE;EACE,gBAAA;ACEJ;;ADAE;EACE,kBAAA;EACA,UAAA;ACGJ;;ADDE;EACE,sBAAA;EACA,uBAAA;EACA,WAAA;EACA,wBAAA;EACA,qBAAA;EACA,mBAAA;EACA,gBAAA;EACA,uBAAA;EACA,gBAAA;EACA,gBAAA;EACA,kBAAA;EACA,gBAAA;EACA,eAAA;ACIJ;;ADFE;EAEE,YAAA;EACA,aAAA;EACA,iBAAA;EACA,kBAAA;ACIJ;;ADDI;EAAG,gBAAA;ACKP;;ADJI;EACE,WAAA;EACA,aAAA;EACA,eAAA;EACA,mBAAA;EACA,uBAAA;ACON;ADNM;EACE,YAAA;EACA,eAAA;EACA,sBAAA;EACA,sBAAA;EACA,kBAAA;ACQR;;ADLI;EACC,YAAA;EACC,aAAA;ACQN;;ADLI;EACE,kBAAA;EACA,eAAA;ACQN;;ADLI;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACQN;;ADNM;EACE,kBAAA;EACA,UAAA;ACSR;;ADNM;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACSR","file":"reportbuildall.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.html new file mode 100644 index 0000000..cfcd34e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.html @@ -0,0 +1,112 @@ + +
+ + +
+
+
+

{{ 'REPORT' | translate }}

+
+
+ + +
+
+ + + + + + + + + Loading ... +
{{error}}
+ + + + {{'GO_TO' | translate}} + + + {{ 'REPORT_RUNNER' | translate }} + + + {{ 'REPORT_DESCRIPTION' | translate }} + + + {{ 'ACTIVE' | translate }} + + + {{ 'FOLDER_NAME' | translate }} + + + {{ 'ACTION' | translate }} + + + + {{ 'SET_UP' | translate }} + {{user.reportName}} + {{user.description}} + {{user.active}} + {{user.folderName}} + + + + {{ 'DELETE' | translate }} + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+ + +
+ + + + + +
+ + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.scss new file mode 100644 index 0000000..aec3e9d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.scss @@ -0,0 +1,83 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; + } + .td-content{ + text-align: left; + } + .delete,.heading{ + text-align: center; + color: red; + } + input[type='radio']{ + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; + } + .dots + { + width: 100px; + height:100px; + border: 1px solid; + border-radius: 50%; + //background-color: #f00; + } + h4{margin-top: 16px;} + .s-order-dash-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + } + } + #word1{ + width: 190px; + height: 180px; + + } + .center{ + text-align: center; + margin-top: 5px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + .heading{ + text-align: center; + color: red; + } + + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.spec.ts new file mode 100644 index 0000000..fce8821 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportbuildallComponent } from './reportbuildall.component'; + +describe('ReportbuildallComponent', () => { + let component: ReportbuildallComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportbuildallComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportbuildallComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.ts new file mode 100644 index 0000000..25c291b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildall/reportbuildall.component.ts @@ -0,0 +1,92 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; +import { ToastrService } from 'ngx-toastr'; + +@Component({ + selector: 'app-reportbuildall', + templateUrl: './reportbuildall.component.html', + styleUrls: ['./reportbuildall.component.scss'] +}) +export class ReportbuildallComponent implements OnInit { + gridData; + loading = false; + error; + selected: any[] = []; + rowSelected :any= {}; + modaldelete=false; + isLoading: boolean = false; + projectId; + moduleId; + projectname; + constructor(private router: Router, + private route: ActivatedRoute,private reportBuilderService: ReportBuilderService, + private toastr:ToastrService, ) { } + + ngOnInit(): void { + + this.getAll(); + } + + + getAll() { + this.isLoading = true; + this.reportBuilderService.getrbDetails().subscribe((data) => { + this.isLoading = false; + console.log(data); + + const filteredData = data.filter(item => item.isSql === true); + this.gridData = filteredData; + if(this.gridData.length == 0){ + this.error="No data Available"; + console.log(this.error); + } + }); + } + + gotorunner() + { + this.router.navigate(['../../rerunner'],{relativeTo:this.route}); + } + + + goToAdd() { + this.router.navigate(["../add"], { relativeTo: this.route, }); + } + + goToEdit(id: number) { + this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + enid; + modelData:any[]=[]; + goToLines(val) { + console.log(val); +this.enid=val.id; +// this.modelData = val.Rpt_builder2_lines[0].model; + + if(val.Rpt_builder2_lines[0].model !== '' ){ + this.router.navigate(["../edit/" + this.enid], { relativeTo: this.route }); + } + else{ + this.router.navigate(["../reportQuery/" + this.enid], { relativeTo: this.route, }); + } + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id){ + this.modaldelete = false; + this.reportBuilderService.deletrbById(id).subscribe((data) => { + console.log(data); + if(data || data == null || data.status >= 200 && data.status <= 209){ + this.toastr.success("Deleted successfully"); + } + this.ngOnInit(); + },(error) => { + console.log(error); + this.toastr.error("getting error in deleting data"); + }) + } + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.css new file mode 100644 index 0000000..e938509 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.css @@ -0,0 +1,56 @@ +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; +} +.s-info-bar button { + outline: none; +} + +.edit-pg { + width: 750px; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +#lines table, +#lines th, +#lines td { + border: 0.5px solid #f1f0f0; + border-collapse: collapse; +} +#lines input, +#lines input :focus { + outline: none; + border-width: 0px; + border: none; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} + +textarea { + width: 100%; + padding: 15px 15px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +}/*# sourceMappingURL=reportbuildedit.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.css.map new file mode 100644 index 0000000..576b0f3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["reportbuildedit.component.scss","reportbuildedit.component.css"],"names":[],"mappings":"AACA;EACI,aAAA;EACA,mBAAA;EACA,8BAAA;ACAJ;ADCI;EACE,aAAA;ACCN;;ADGE;EACE,YAAA;ACAJ;;ADEE;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACCJ;;ADEI;;;EAGE,2BAAA;EACA,yBAAA;ACCN;ADCI;;EAGE,aAAA;EACA,iBAAA;EACA,YAAA;ACAN;;ADIE;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACDJ;;ADIE;EACE,kBAAA;ACDJ;;ADGE;EACE,WAAA;EACA,kBAAA;EAEA,oCAAA;EACA,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACDJ","file":"reportbuildedit.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.html new file mode 100644 index 0000000..f05be3b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.html @@ -0,0 +1,66 @@ +
+

REPORT SET UP - Project Details Report ({{ReportData.id}})

+ Edit Mode +
+
+
+
+
+
+
+
+ + +

+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ + +
+ +
+ + +
+
+
+
+ + +
+
+
+ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.scss new file mode 100644 index 0000000..9893e7c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.scss @@ -0,0 +1,58 @@ +// @import "../../../../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .edit-pg { + width: 750px; + } + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + #lines { + table, + th, + td { + border: 0.5px solid #f1f0f0; + border-collapse: collapse; + } + input, + input :focus { + //-webkit-appearance: none; + outline: none; + border-width: 0px; + border: none; + } + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.spec.ts new file mode 100644 index 0000000..011630a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportbuildeditComponent } from './reportbuildedit.component'; + +describe('ReportbuildeditComponent', () => { + let component: ReportbuildeditComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportbuildeditComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportbuildeditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.ts new file mode 100644 index 0000000..8bd117c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildedit/reportbuildedit.component.ts @@ -0,0 +1,144 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; + + + +@Component({ + selector: 'app-reportbuildedit', + templateUrl: './reportbuildedit.component.html', + styleUrls: ['./reportbuildedit.component.scss'] +}) +export class ReportbuildeditComponent implements OnInit { + public entryForm: FormGroup; + updated = false; + ReportData:any = {}; + id: number; + nodeEditProperties = { + std_param_html:'', + adhoc_param_html:'', + column_str:'', + conn_name:'', + date_param_req:'', + // folderName:'', + sql_str:'', + +}; + constructor(private router: Router, + private route: ActivatedRoute,private reportBuilderService: ReportBuilderService, + private toastr: ToastrService, private _fb: FormBuilder) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + + this.entryForm = this._fb.group({ + std_param_html : [null], + adhoc_param_html:[null], + column_str:[null], + conn_name:[null], + date_param_req:[null], + // folderName:[null], + sql_str:[null], + }); + + this.getById(this.id); + this.listoddatabase(); + } + databaselist; + listoddatabase(){ + this.reportBuilderService.getdatabse().subscribe((data)=>{ + this.databaselist=data; + console.log(this.databaselist) + },(error) => { + console.log(error); + if(error){ + } + }); + + } + builderLine; + lineId; + builderLineData; + getById(id: number) { + this.reportBuilderService.getrbDetailsById(id).subscribe( + (data) => { + console.log(data); + this.ReportData = data; + + + this.builderLine = this.ReportData.rpt_builder2_lines; + this.lineId = this.builderLine[0].id + console.log("line data ",this.lineId, this.builderLine); + if(this.builderLine[0].model != '') + { + this.builderLineData = JSON.parse(this.builderLine[0].model) ; + console.log(this.builderLineData); + + this.nodeEditProperties.std_param_html = this.builderLineData.std_param_html; + this.nodeEditProperties.adhoc_param_html = this.builderLineData.adhoc_param_html; + this.nodeEditProperties.column_str = this.builderLineData.column_str; + this.nodeEditProperties.conn_name = this.builderLineData.conn_name; + this.nodeEditProperties.date_param_req = this.builderLineData.date_param_req; + this.nodeEditProperties.sql_str = this.builderLineData.sql_str; + } + }, + (err) => { + console.log(err); + } + ); + } + + listBuilder_Lines = { + model:{} + } + update() { + + this.builderLineData.std_param_html = this.nodeEditProperties.std_param_html; + this.builderLineData.adhoc_param_html = this.nodeEditProperties.adhoc_param_html; + this.builderLineData.column_str = this.nodeEditProperties.column_str; + this.builderLineData.conn_name = this.nodeEditProperties.conn_name ; + this.builderLineData.date_param_req = this.nodeEditProperties.date_param_req; + this.builderLineData.sql_str = this.nodeEditProperties.sql_str; + console.log(this.builderLineData); + // this.builderLineData.splice(1); + console.log(this.builderLineData); + let tmp = JSON.stringify(this.builderLineData); //.replace(/\\/g, '') + this.listBuilder_Lines.model = tmp; +console.log(this.listBuilder_Lines); + + this.reportBuilderService.updaterbLineData(this.listBuilder_Lines, this.lineId).subscribe( + (data) => { + console.log(data); + if (data) { + this.toastr.success('Update successfully'); + } + this.router.navigate(["../../all"], { relativeTo: this.route }); + //this.router.navigate(["../../all"],{ relativeTo: this.route, queryParams: { p_id: this.projectId } }); + }, + (error) => { + // console.log(error); + // const objectArray = Object.entries(error.error.fieldErrors); + // objectArray.forEach(([k, v]) => { + // console.log(k); + // console.log(v); + // this.fieldErors.push({ field: k, message: v }); + // }); + console.log(error); // this will come from backend + } + ); + // this.lineBuilder_Header = new Rn_Cff_ActionBuilder_Header(); + } + + onSubmit() { + this.updated = true; + this.update(); + } + + back() { + this.router.navigate(["../../all"], { relativeTo: this.route }); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.css new file mode 100644 index 0000000..f328a84 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.css @@ -0,0 +1,146 @@ +@import '@swimlane/ngx-datatable/index.css'; +@import '@swimlane/ngx-datatable/themes/bootstrap.css'; +@import '@swimlane/ngx-datatable/assets/icons.css'; +.button1::after { + content: none; +} + +.button1:hover::after { + content: "ADD ROWS"; +} + +.delete, .heading { + text-align: center; + color: red; +} + +.bold { + font-weight: bold; +} + +.section p { + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.required-field { + color: red; + font-size: 18px; +} + +input[type=text], textarea { + width: 100%; + padding: 15px 15px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +html { + /* make sure we use up the whole viewport */ + width: 100%; + min-height: 100vh; +} + +body { + width: 100%; + background-color: gray; +} + +ngx-datatable { + font-family: Metropolis, Avenir Next, Helvetica Neue, Arial, sans-serif; + font-size: 13px; + border: 1px solid #ccc; + border-radius: 2px; + padding: 0; + background-color: #fff; +} +ngx-datatable .datatable-header, ngx-datatable .datatable-footer { + font-size: 11px; + line-height: 18px; + font-weight: bold; + background-color: #fafafa; +} +ngx-datatable .datatable-header { + box-shadow: 0 2px 4px 0px #ccc; +} +ngx-datatable .datatable-header .datatable-header-cell { + line-height: 22px; + padding-left: 10px; + height: 22px; +} +ngx-datatable .datatable-header .datatable-header-cell:not(:first-child) { + border-left: 1px solid #ccc; +} +ngx-datatable .datatable-footer { + border-top: 1px solid #ccc; +} +ngx-datatable .datatable-footer .page-count { + margin: 10px; +} +ngx-datatable .datatable-footer .pages a { + padding: 8px; + color: inherit; +} +ngx-datatable .datatable-footer .pages.active a { + padding: 8px; + color: #007cbb; + background-color: rgb(221, 221, 221); + text-align: center; +} +ngx-datatable .datatable-header-inner { + padding: 12px; +} +ngx-datatable .datatable-body-cell { + padding: 8px 0 10px 20px; + border-top: 1px solid #ddd; +} +ngx-datatable .pager i { + font-size: 18px; + vertical-align: middle; +} + +.postColumn { + border: 1px solid #ccc; + width: 78%; + margin-left: 15px; +} + +.colName { + text-align: center; + padding: 5px; +} + +.colfields { + border: 1px solid black; + margin: 17px; + text-align: center; + padding: 3px; +} + +.fieldWrapper { + margin-top: 20px; +} + +.center { + text-align: center; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +}/*# sourceMappingURL=reportbuildquery.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.css.map new file mode 100644 index 0000000..ec63f0f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["reportbuildquery.component.scss","reportbuildquery.component.css"],"names":[],"mappings":"AA8JQ,2CAAA;AACA,sDAAA;AACC,kDAAA;AA9JT;EACE,aAAA;ACEF;;ADAA;EACE,mBAAA;ACGF;;ADAA;EACE,kBAAA;EACA,UAAA;ACGF;;ADAA;EACE,iBAAA;ACGF;;ADCA;EAEE,aAAA;EACA,eAAA;ACCF;;ADEA;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACCF;;ADWA;EACE,UAAA;EACF,eAAA;ACRA;;ADYA;EACE,WAAA;EACA,kBAAA;EAED,oCAAA;EACC,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACVF;;ADcA;EACI,2CAAA;EACA,WAAA;EACA,iBAAA;ACXJ;;ADaA;EACI,WAAA;EACA,sBAAA;ACVJ;;ADeA;EACE,uEAAA;EACA,eAAA;EACA,sBAAA;EACA,kBAAA;EACA,UAAA;EACA,sBAAA;ACZF;ADaE;EACE,eAAA;EACA,iBAAA;EACA,iBAAA;EACA,yBAAA;ACXJ;ADaE;EAEE,8BAAA;ACZJ;ADaI;EACE,iBAAA;EACA,kBAAA;EACA,YAAA;ACXN;ADcE;EACI,2BAAA;ACZN;ADeE;EACE,0BAAA;ACbJ;ADcI;EACE,YAAA;ACZN;ADcI;EACE,YAAA;EACA,cAAA;ACZN;ADcI;EACE,YAAA;EACA,cAAA;EACA,oCAAA;EACA,kBAAA;ACZN;ADgBE;EACE,aAAA;ACdJ;ADgBE;EACE,wBAAA;EACA,0BAAA;ACdJ;ADgBE;EACE,eAAA;EACA,sBAAA;ACdJ;;ADkBA;EACE,sBAAA;EACA,UAAA;EACA,iBAAA;ACfF;;ADiBA;EACE,kBAAA;EACA,YAAA;ACdF;;ADgBA;EACE,uBAAA;EACA,YAAA;EACA,kBAAA;EACA,YAAA;ACbF;;ADeA;EACE,gBAAA;ACZF;;ADcA;EACE,kBAAA;ACXF;;ADcA;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACXF","file":"reportbuildquery.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.html new file mode 100644 index 0000000..723cd1c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.html @@ -0,0 +1,670 @@ + + +
+ + +
+
+

SQL Worksheet- + connection name + {{databaseName}} + switch + Add New +

+ +
+ +
+ + +
+
+ + + + + + +
+
+ +
+
+ + + + + + + + + {{selected}} {{ getAliasedColumn(selected) }} + + + + {{state}} + + + + +
+

+ +
+
+
+ + + + + + + + + {{ selected.substr(0, selected.indexOf('.')) }}{{ selected.substr(selected.indexOf('.')) }} + + + {{selected}} + + + + + {{state}} + + + + +
+

+

{{msg}}

+
+
+
+ + + + + + {{data.andor}}  + + {{ selected.substr(0, selected.indexOf('.')) }}{{ selected.substr(selected.indexOf('.')) }} + + + {{selected}} + + + {{data.condition}} {{data.value}} + + + + + {{state}} + + + + +
+

+

{{msg}}

+
+ +
+
+ + + + + + + + + {{ selected.substr(0, selected.indexOf('.')) }}{{ selected.substr(selected.indexOf('.')) }} + + + {{selected}} + + + + + {{state}} + + + + +
+

+

{{msg}}

+
+ +
+
+ + +
+
+ + +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ + + +
+
+
+ + + +
+
+

Response

+
+
+
+
+
+

+
+
+
+
+ + + + + + + + + + + + + +
{{co}}
{{item[key]}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.scss new file mode 100644 index 0000000..3ee5c25 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.scss @@ -0,0 +1,161 @@ +$bg-color: #dddddd; + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.delete,.heading{ + text-align: center; + color: red; +} + +.bold{ + font-weight: bold; +} + + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} +// input[type=text],[type=date],textarea { +// width: 60%; +// padding: 15px 15px; +// // margin: 8px 0; +// background-color:rgb(255, 255, 255); +// display: inline-block; +// border: 1px solid #ccc; +// border-radius: 4px; +// box-sizing: border-box; +// } +.required-field{ + color: red; +font-size: 18px; + +} + +input[type=text],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + + +html { + /* make sure we use up the whole viewport */ + width: 100%; + min-height: 100vh; +} +body { + width: 100%; + background-color: gray; + //min-height: 100vh; /* this helps with the sticky footer */ +} + +//Import classes from swimlane datatable +ngx-datatable { + font-family: Metropolis,Avenir Next,Helvetica Neue,Arial,sans-serif; + font-size:13px; + border:1px solid #ccc; + border-radius: 2px; + padding:0; + background-color: #fff; + .datatable-header, .datatable-footer { + font-size:11px; + line-height:18px; + font-weight:bold; + background-color:#fafafa; + } + .datatable-header{ + //border-bottom: 2px solid #ccc; + box-shadow: 0 2px 4px 0px #ccc; + .datatable-header-cell{ + line-height:22px; + padding-left:10px; + height:22px; + } + } + .datatable-header .datatable-header-cell:not(:first-child) { + border-left:1px solid #ccc; + } + + .datatable-footer{ + border-top: 1px solid #ccc; + .page-count{ + margin: 10px; + } + .pages a{ + padding:8px; + color:inherit; + } + .pages.active a{ + padding:8px; + color:#007cbb; + background-color:rgb(221, 221, 221); + text-align: center; + } + } + + .datatable-header-inner{ + padding:12px; + } + .datatable-body-cell{ + padding:8px 0 10px 20px; + border-top: 1px solid #ddd; + } + .pager i { + font-size:18px; + vertical-align: middle; + } +} + +.postColumn{ + border: 1px solid #ccc; + width: 78%; + margin-left: 15px; +} +.colName{ + text-align: center; + padding: 5px; +} +.colfields{ + border: 1px solid black; + margin: 17px; + text-align: center; + padding: 3px; +} +.fieldWrapper{ + margin-top: 20px; +} +.center { + text-align: center; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +// @import '@swimlane/ngx-datatable/index.css'; +// @import '@swimlane/ngx-datatable/themes/bootstrap.css'; +// @import '@swimlane/ngx-datatable/assets/icons.css'; diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.spec.ts new file mode 100644 index 0000000..96b95f4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportbuildqueryComponent } from './reportbuildquery.component'; + +describe('ReportbuildqueryComponent', () => { + let component: ReportbuildqueryComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportbuildqueryComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportbuildqueryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.ts new file mode 100644 index 0000000..3c23b53 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build/reportbuildquery/reportbuildquery.component.ts @@ -0,0 +1,660 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; +import { TableList } from '../../../../../models/fnd/table-setup'; +import { HttpClient, HttpErrorResponse } from '@angular/common/http'; +import { ToastrService } from 'ngx-toastr'; +import { ActivatedRoute, Router } from '@angular/router'; + +@Component({ + selector: 'app-reportbuildquery', + templateUrl: './reportbuildquery.component.html', + styleUrls: ['./reportbuildquery.component.scss'] +}) +export class ReportbuildqueryComponent implements OnInit { + searchtable: any; + searchcol: any; + columns: any[]; + table: boolean = false; + database: boolean = false; + query: boolean = false; + public entryForm: FormGroup; + public addForm: FormGroup; + public saveReportForm: FormGroup; + addmodal: boolean = false; + query2: string; + rows: any[]; + loading = false; + tableList: TableList[]; + databaselist = []; + collist; + search: any; + selectedtable: any[]; + selectedcol: any[]; + selectedcol1: any[]; + selectedParamter: any[]; + selectedtablequery; + selectcolquery; + selectedquery; + backQuery = true; + searchquery; + col: boolean = false; + col1: boolean = false; + searchdatabase; + selecteddatabase; + msg; + id; + querydata; + errorco; + errortb; + errorcl; + loadingIndicator = true; reorderable = true; + columnModal = false; + reportModal = false; + filterModel = false; + conditionData = []; + stdParamters = []; + columnData = []; + andor = ['AND', 'OR', 'NOT']; + fieldname = ['name1', 'name2']; + condition = ['=', '!=', '<', '>', '<=', '>=', 'LIKE', 'BETWEEN', 'IN']; + alias = ['a', 'b', 'c', 'd', 'e', 'f']; + tabs = ['Tab', 'Tab',]; + selected = new FormControl(0); + constructor(private _fb: FormBuilder, private router: Router, + private route: ActivatedRoute, + private reportBuilderService: ReportBuilderService, private toastr: ToastrService,) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + this.entryForm = this._fb.group({ + sql_query: [null], + }); + this.addForm = this._fb.group({ + conn_string: [null], + username: [null], + password: [null], + driver_class_name: [null], + }) + + this.saveReportForm = this._fb.group({ + conn_name: [null], + // reportName: [null], + folderName: [null], + // description:[null], + // active:[null], + sql_str: [null], + date_param_req: [null], + column_str: [null], + adhoc_param_html: [null], + std_param_html: [null], + }); + // this.listofTables(); + this.getById(this.id); + + } + ReportBuilder_Header; + ReportBuilder_Line; + lineId; + getById(id: number) { + this.reportBuilderService.getrbDetailsById(id).subscribe( + (data) => { + console.log(data); + this.ReportBuilder_Header = data; + console.log(data.Rpt_builder2_lines[0].model); + this.ReportBuilder_Line = data.Rpt_builder2_lines + this.lineId = data.Rpt_builder2_lines[0].id; + }, + (err) => { + console.log(err); + } + ); + } + + + listoddatabase() { + this.reportBuilderService.getdatabse().subscribe((data) => { + this.databaselist = data; + console.log('database list ', this.databaselist) + + if (this.databaselist.length == 0) { + this.errorco = "No data Available"; + + } + }, (error) => { + console.log(error); + if (error) { + this.errorco = "No data Available"; + } + }); + + } + listofTables(val) { + this.reportBuilderService.getTableListn(val).subscribe(data => { + // console.log("table list "+data); + this.tableList = data; + console.log(this.tableList); + }, (error) => { + console.log(error); + if (error) { + this.errortb = "No data Available"; + } + }) + } + msg1; + finalColList: any[] = []; + listofcol(val) { + console.log(this.selectedtable); + console.log(this.selectedcol); + console.log(this.selectedcol1); + const tableString = JSON.stringify(val); + console.log(tableString); + const array = Array.of(val); // Using the Array constructor + console.log(array); + console.log(val); + // this.reportBuilderService.getcolListn(this.name[1],val).subscribe((data)=>{ + // this.reportBuilderService.getColumnList(this.name[1],array).subscribe((data)=>{ + this.reportBuilderService.getAllColumnsFromAllTables(array).subscribe((data) => { + console.log(data); + this.collist = data; + // this.finalColList.push(data); + // this.finalColList.push(this.collist) + if (this.selectedtable == null) { + this.msg = 'Plz First Select Table' + } else { + this.msg = ""; + } + + //console.log(this.collist); + }, (error) => { + console.log(error); + if (error) { + this.errorcl = "No data Available"; + } + }) + } + listofquery() { + this.reportBuilderService.getall().subscribe((data) => { + this.querydata = data; + console.log(this.querydata) + }) + } + rowdata; + onSubmit() { + // this.backQuery = false; + + this.query2 = this.entryForm.value.sql_query; + console.log(this.query2); + this.reportBuilderService.getMasterData(this.query2).subscribe((data) => { + this.rows = data; + console.log(this.rows); + this.rowdata = [this.rows]; + console.log(typeof this.rows); + if (data) { + this.toastr.success("Run Successfully") + } + var j; + var cart = []; + + for (var i = 0; i < data.length; i++) { + var columnsIn = data[i]; + if (i == 1) { + for (var key in columnsIn) { + j = { prop: key, name: key }; + cart.push(j) + + } + } + } + this.columns = cart; + + }); + } + getHeaders() { + let headers: string[] = []; + if (this.rows) { + this.rows.forEach((value) => { + Object.keys(value).forEach((key) => { + if (!headers.find((header) => header == key)) { + headers.push(key) + } + + }) + + }) + } + return headers; + } + savequery() { + //this.query2=this.entryForm.value.sql_query; + console.log(this.entryForm.value); + this.reportBuilderService.saveq(this.entryForm.value).subscribe((data) => { + console.log(data); + }) + + } + + //tab + addTab(selectAfterAdding: boolean) { + this.tabs.push('Tab'); + + if (selectAfterAdding) { + this.selected.setValue(this.tabs.length - 1); + } + } + + removeTab(index: number) { + this.tabs.splice(index, 1); + } + opendatabsemo() { + this.database = true; + this.listoddatabase(); + } + name; + databaseName; + databasename(val) { + console.log(val); + this.databaseName = val.name; + this.selecteddatabase = val.conn_string; + console.log(this.selecteddatabase); + // this.selecteddatabase.substring(0,this.selecteddatabase.indexOf(':3306/')) + // console.log(this.selecteddatabase); + this.name = this.selecteddatabase.split(":3306/"); + console.log(this.name[1]); + this.database = false; + this.listofTables(this.name[1]) + } + opentablemod() { + this.table = true; + // this.listofTables(); + } + tablename(value) { + console.log(value); + this.selectedtable = value; + this.table = false; + } + tableModal = false; + TableData; + opentcolmod() { + // this.col=true; + + if (this.selectedtable == null) { + this.msg = 'Plz First Select Table' + } else { + this.msg = ""; + // this.tableModal = true; + } + this.listofcol(this.selectedtable) + + if (Array.isArray(this.selectedtable) || this.selectedtable === undefined) { + const selectedTables = this.selectedtable.map((table, index) => { + const alias = String.fromCharCode(97 + (index % 26)); // Generate aliases starting from 'a' + console.log(alias, table); + return `${table} ${alias}`; + }).join(','); + console.log(selectedTables); + // const selectedTables = this.TableData.map(({ alias, tables }) => `${tables} ${alias}`).join(','); + // console.log(selectedTables); + + this.selectedtablequery = `SELECT * FROM ${selectedTables} WHERE 1=1`; + console.log(this.selectedtablequery); + // You can perform further actions with the generated SQL query + } else { + this.selectedtablequery = ''; + console.log(this.selectedtablequery); + // You can perform further actions with the generated SQL query + } + + this.selectedquery = this.selectedtablequery; + + // const defaultObject = { + // alias: "", + // } + // const objectArray = this.selectedtable.map(value => ({ + // ...defaultObject, + // tables: value, + // })); + // console.log(objectArray); + // const data = JSON.stringify(objectArray); + // try { + // this.TableData = JSON.parse(data); + // console.log('Received data:', this.TableData ); + // } catch (e) { console.error('Invalid JSON:', data);} + } + opentcolmod1() { + // this.col1=true; + this.listofcol(this.selectedtable) + + + } + colname() { + + this.columnModal = true; + + //column filter + const defaultObject = { + alias: "", + } + const valuesOnly = this.selectedcol.map(item => item.split('.').pop()); + const objectArray = this.selectedcol.map((value, index) => ({ + // ...defaultObject, + alias: valuesOnly[index], + columns: value, + })); + console.log(objectArray); + const data = JSON.stringify(objectArray); + try { + this.columnData = JSON.parse(data); + console.log('Received data:', this.columnData); + } catch (e) { console.error('Invalid JSON:', data); } + } + onAddColLines() { + this.columnData.push({ + columns: "", + alias: "", + }); + } + deleteColRow(index) { + this.columnData.splice(index, 1); + } + // console.log(col); + // this.selectedcol=col; + + onColSelected() { + // console.log(col); + // this.selectedcol=col; + this.col = false; + this.columnModal = false; + if (Array.isArray(this.columnData)) { + // const selectedColumns = this.columnData.join(','); + //for column + const selectedColumns = this.columnData.map(({ alias, columns }) => `${columns} as ${alias}`).join(','); + console.log(selectedColumns); + //for table + const selectedTables = this.selectedtable.map((table, index) => { + const alias = String.fromCharCode(97 + (index % 26)); // Generate aliases starting from 'a' + console.log(alias, table); + return `${table} ${alias}`; + }).join(','); + console.log(selectedTables); + + // const selectedTables = this.TableData.map(({ alias, tables }) => `${tables} ${alias}`).join(','); + // console.log(selectedTables); + + this.selectcolquery = `SELECT ${selectedColumns} FROM ${selectedTables} WHERE 1=1`; + console.log(this.selectcolquery); + // You can perform further actions with the generated SQL query + } else if (Array.isArray(this.selectedtable)) { + //for table + const selectedTables = this.selectedtable.map((table, index) => { + const alias = String.fromCharCode(97 + (index % 26)); // Generate aliases starting from 'a' + console.log(alias, table); + return `${table} ${alias}`; + }).join(','); + console.log(selectedTables); + this.selectcolquery = `SELECT * FROM ${selectedTables} WHERE 1=1`; + console.log(this.selectcolquery); + // You can perform further actions with the generated SQL query + } else { + // if(this.selectedtable==null){ + // this.msg1='Plz First Select Table' + // }else{ + // this.msg1=""; + // } + } + this.selectedquery = this.selectcolquery; + } + + // onColSelected(){ + // this.col=false; + // this.columnModal = false; + // console.log(this.selectedcol); + // if (Array.isArray(this.selectedcol)) { + // const selectedColumns = this.selectedcol.join(','); + // this.selectcolquery = `SELECT ${selectedColumns} FROM ${this.selectedtable} WHERE 1=1`; + // console.log(this.selectcolquery); + // // You can perform further actions with the generated SQL query + // } else { + // this.selectcolquery = `SELECT * FROM ${this.selectedtable} WHERE 1=1`; + // console.log(this.selectcolquery); + // // You can perform further actions with the generated SQL query + // } + // this.selectedquery = this.selectcolquery; + + // //std pramameter + // const defaultObject = { + // label: "", + // dataType: "", + // list: "", + // } + // const objectArray = this.selectedcol.map(value => ({ + // ...defaultObject, + // column: value, + // })); + // console.log(objectArray); + // const data = JSON.stringify(objectArray); + // try { + // this.stdParamters = JSON.parse(data); + // console.log('Received data:', this.stdParamters ); + // } catch (e) { console.error('Invalid JSON:', data);} + // } + onAddstdLines() { + this.stdParamters.push({ + column: "", + label: "", + dataType: "", + list: "" + }); + } + deletestdRow(index) { + this.stdParamters.splice(index, 1); + } + colname1() { + // console.log(col); + // this.selectedcol1=col; + // this.col1=false; + // this.listofquery(); + } + openquerymod() { + this.query = true; + this.listofquery(); + } + selectquery(val) { + console.log(val); + this.selectedquery = val; + this.query = false; + } + opencopym() { + // this.router.navigate(['cns-portal', 'reportbuild','reportQuery', this.id, 'queryadd']); + this.router.navigate(['queryadd'], { relativeTo: this.route }); + } + + onCreate() { + console.log(this.addForm.value); + this.reportBuilderService.createdb(this.addForm.value).subscribe((data) => { + console.log(data); + }) + } + + // onSelectedChanged(selected){ + // this.selectedTableData = this.tableList.filter(item => item.selected); + // } + conditionVal; + filter(val) { + + this.filterModel = true; + this.conditionVal = val; + + const defaultObject = { + andor: "AND", + // alias: "", + condition: "=", + value: "", + } + const objectArray = this.conditionVal.map(value => ({ + ...defaultObject, + fields_name: value, + })); + console.log(objectArray); + const data = JSON.stringify(objectArray); + try { + this.conditionData = JSON.parse(data); + console.log('Received data:', this.conditionData); + } catch (e) { console.error('Invalid JSON:', data); } + } + + onAddLines() { + this.conditionData.push({ + andor: "AND", + fields_name: "", + condition: "=", + value: "" + }); + } + deleteRow(index) { + this.conditionData.splice(index, 1); + } + filteredConditionData; + filterAndor; + filtercondlvalue; + onSelected() { + this.filterModel = false; + console.log(this.conditionData); + let formattedString = ''; + for (const condition of this.conditionData) { + const { andor, fields_name, condition: cond, value } = condition; + formattedString += `${andor} ${fields_name} ${cond} '${value}'`; + this.filterAndor = andor; + this.filtercondlvalue = cond + ' ' + value; + } + // this.getConditionBeforeColumn(this.selectedcol1) + // this.getConditionAfterColumn(this.selectedcol1); + console.log(formattedString); + this.filteredConditionData = formattedString + if (this.selectcolquery !== undefined) { + const mQuery = this.selectcolquery + ' ' + formattedString; + console.log(mQuery); + this.selectedquery = mQuery; + } else { + const mQuery = this.selectedtablequery + ' ' + formattedString; + console.log(mQuery); + this.selectedquery = mQuery; + } + } + + // getConditionBeforeColumn(selected: any){ + + // return this.filterAndor; + + + // } + // getConditionAfterColumn(selected: any){ + // return this.filtercondlvalue + + + // } + onBack() { + // this.backQuery = true; + } + + getAliasedColumn(selected: string) { + const index = this.selectedtable.findIndex(item => item === selected); + const alphabet = 'abcdefghijklmnopqrstuvwxyz'; + const aliasIndex = index % alphabet.length; // Calculate the index based on the remainder + const repeatedAlias = alphabet.charAt(aliasIndex); + return repeatedAlias; + } + + goToEdit(id) { + this.router.navigate(["../queryedit/" + id], { relativeTo: this.route }); + } + + rowSelected: any = {}; + modaldelete = false; + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.reportBuilderService.deleteSqlModel(id).subscribe( + (data) => { + console.log(data); + this.listoddatabase(); + if (data) { + this.toastr.success('Deleted successfully'); + } + }, + (error) => { + console.log('Error in adding data...', +error); + if (isNaN(error)) { + this.toastr.success('Deleted successfully'); + } else { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + this.listoddatabase(); + } + ); + } + + + workflow_Lines = { + model: {} + } + foldername; + dataParameter; + + saveReport() { + // this.reportModal = true; + this.rpt_builder(); + } + + rpt_builder() { + + + + + + this.onSaveBuidler(); + } + onSaveBuidler() { + this.reportModal = false; + this.saveReportForm.value.sql_str = this.selectedquery; + this.saveReportForm.value.date_param_req = this.dataParameter; + this.saveReportForm.value.folderName = this.foldername; + this.saveReportForm.value.conn_name = this.databaseName; + const col_str = JSON.stringify(this.selectedcol); + this.saveReportForm.value.column_str = col_str; + const colList = JSON.stringify(this.collist); + this.saveReportForm.value.adhoc_param_html = colList; + const table_str = JSON.stringify(this.selectedtable); + // this.saveReportForm.value.std_param_html = table_str; + this.saveReportForm.value.std_param_html = col_str; + + console.log(this.saveReportForm.value); + let tmp = JSON.stringify(this.saveReportForm.value); //.replace(/\\/g, '') + this.workflow_Lines.model = tmp; + // this.ReportBuilder_Header.Rpt_builder2_lines[0].model = tmp + console.log(this.workflow_Lines); + + this.reportBuilderService.updaterbLineData(this.workflow_Lines, this.lineId).subscribe((data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 209) { + this.toastr.success('Report save successfully'); + this.router.navigate(["../../all"], { relativeTo: this.route }); + } + }, (error: HttpErrorResponse) => { + console.log(error); + if (error.status == 404) { + this.toastr.error(error.error); + } + if (error.status == 200) { this.toastr.success('Report save successfully'); } + if (error.status == 400) { this.toastr.error('Report Save Unsuccessful'); } + }); + // this.router.navigate(["../../all"], { relativeTo: this.route }); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.spec.ts new file mode 100644 index 0000000..1b0545d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportBuild2Component } from './report-build2.component'; + +describe('ReportBuild2Component', () => { + let component: ReportBuild2Component; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportBuild2Component ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportBuild2Component); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.ts new file mode 100644 index 0000000..e29256b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-report-build2', + templateUrl: './report-build2.component.html', + styleUrls: ['./report-build2.component.scss'] +}) +export class ReportBuild2Component implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.html new file mode 100644 index 0000000..587e702 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.html @@ -0,0 +1,79 @@ +

{{'CREATE_NEW_REPORT'|translate}}

+{{'add_mode'|translate}}
+
+
+ + + + + +
+ +
+
+ + + +
+
+ + +
+
+ + +
+ +
+ + + +
+
+
+ + +
+
+ +
+
+
diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.scss new file mode 100644 index 0000000..39de1cb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.scss @@ -0,0 +1,80 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=date],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.spec.ts new file mode 100644 index 0000000..ae3b340 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportBuild2addComponent } from './report-build2add.component'; + +describe('ReportBuild2addComponent', () => { + let component: ReportBuild2addComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportBuild2addComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportBuild2addComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.ts new file mode 100644 index 0000000..5007d44 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2add/report-build2add.component.ts @@ -0,0 +1,71 @@ +import { HttpErrorResponse, HttpHeaderResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; +@Component({ + selector: 'app-report-build2add', + templateUrl: './report-build2add.component.html', + styleUrls: ['./report-build2add.component.scss'] +}) +export class ReportBuild2addComponent implements OnInit { + public entryForm: FormGroup; + constructor(private _fb: FormBuilder, private router: Router,private toastr: ToastrService, + private route: ActivatedRoute,private reportBuilderService: ReportBuilderService) { } + + ngOnInit(): void { + this.entryForm = this._fb.group({ + reportName: [null], + description:[null], + active:[null], + isSql:[false], + Rpt_builder2_lines: this._fb.array([this.initLinesFormReport()]), + }); + + } + + initLinesFormReport() { + return this._fb.group({ + model: '' + }); + } + stdparams; + keysfromurl; + getkeys(){ + if(this.entryForm.value.url !== null){ + this.reportBuilderService.getcolumnDetailsByurl(this.entryForm.value.url).subscribe(data =>{ + console.log(data); + this.keysfromurl = data; + }) + }else{ + this.toastr.error("URL is required"); + } + } + + + toastrShown: boolean = false; + onSubmit(){ + console.log(this.entryForm.value); + this.reportBuilderService.saverbData(this.entryForm.value).subscribe((data)=>{ + console.log(data); + if (data || data.status >= 200 && data.status <= 209) { + this.toastr.success('Report save successfully'); + } + },(error:HttpErrorResponse) => { + console.log(error); + if(error.status==404){ + this.toastr.error(error.error); + } + if(error.status==200){ this.toastr.success('Report save successfully'); } + if(error.status==400){ this.toastr.error('Report Save Unsuccessful'); } + }); + setTimeout(()=>{ + this.router.navigate(["../all"], { relativeTo: this.route }); + },500); + } + goback(){ + this.router.navigate(["../all"], { relativeTo: this.route }); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.html new file mode 100644 index 0000000..b9660ed --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.html @@ -0,0 +1,102 @@ + +
+ +
+
+
+

{{'REPORT_BUILDER_2' | translate}}

+
+
+ + + +
+
+ + + {{'LOADING' | translate}} +
{{error}}
+ + + + {{'GO_TO' | translate}} + + + {{'REPORT_NAME' | translate}} + + + {{'REPORT_DESCRIPTION' | translate}} + + + {{'ACTIVE' | translate}} + + + {{'ACTION' | translate}} + + + + {{'SET_UP' | translate}} + {{user.reportName}} + {{user.description}} + {{user.active}} + + + + {{'DELETE' | translate}} + + + + +
{{'WHO_COLUMN' | translate}}
+
{{'ACCOUNT_ID' | translate}}: {{user.accountId}}
+
{{'CREATED_AT' | translate}}: {{user.createdAt | date}}
+
{{'CREATED_BY' | translate}}: {{user.createdBy}}
+
{{'UPDATED_AT' | translate}}: {{user.updatedAt | date}}
+
{{'UPDATED_BY' | translate}}: {{user.updatedBy}}
+
+
+ + +
+ + + + + +
+ + + + {{'USERS_PER_PAGE' | translate}} + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.scss new file mode 100644 index 0000000..aec3e9d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.scss @@ -0,0 +1,83 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; + } + .td-content{ + text-align: left; + } + .delete,.heading{ + text-align: center; + color: red; + } + input[type='radio']{ + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; + } + .dots + { + width: 100px; + height:100px; + border: 1px solid; + border-radius: 50%; + //background-color: #f00; + } + h4{margin-top: 16px;} + .s-order-dash-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + } + } + #word1{ + width: 190px; + height: 180px; + + } + .center{ + text-align: center; + margin-top: 5px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + .heading{ + text-align: center; + color: red; + } + + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.spec.ts new file mode 100644 index 0000000..5ee51ec --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportBuild2allComponent } from './report-build2all.component'; + +describe('ReportBuild2allComponent', () => { + let component: ReportBuild2allComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportBuild2allComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportBuild2allComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.ts new file mode 100644 index 0000000..9371ab2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2all/report-build2all.component.ts @@ -0,0 +1,91 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; +import { ToastrService } from 'ngx-toastr'; + +@Component({ + selector: 'app-report-build2all', + templateUrl: './report-build2all.component.html', + styleUrls: ['./report-build2all.component.scss'] +}) +export class ReportBuild2allComponent implements OnInit { + + gridData; + loading = false; + error; + selected: any[] = []; + rowSelected :any= {}; + modaldelete=false; + isLoading: boolean = false; + projectId; + moduleId; + projectname; + constructor(private router: Router, + private route: ActivatedRoute,private reportBuilderService: ReportBuilderService, + private toastr:ToastrService, ) { } + + ngOnInit(): void { + + this.getAll(); + } + + + getAll() { + this.isLoading = true; + this.reportBuilderService.getrbDetails().subscribe((data) => { + this.isLoading = false; + console.log(data); + const filteredData = data.filter(item => item.isSql === false); + this.gridData = filteredData; + if(this.gridData.length == 0){ + this.error="No data Available"; + console.log(this.error); + } + }); + } + + gotorunner() + { + this.router.navigate(['../../rerunner'],{relativeTo:this.route}); + } + + goToAdd() { + this.router.navigate(["../add"], { relativeTo: this.route, }); + } + + goToEdit(id: number) { + this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + enid; + modelData:any[]=[]; + goToLines(val) { + console.log(val); +this.enid=val.id; +// this.modelData = val.Rpt_builder2_lines[0].model; + + // if(val.Rpt_builder2_lines[0].model !== '' ){ + this.router.navigate(["../edit/" + this.enid], { relativeTo: this.route }); + // } + // else{ + // this.router.navigate(["../reportQuery/" + this.enid], { relativeTo: this.route, }); + // } + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id){ + this.modaldelete = false; + this.reportBuilderService.deletrbById(id).subscribe((data) => { + console.log(data); + if(data || data == null || data.status >= 200 && data.status <= 209){ + this.toastr.success("Deleted successfully"); + } + this.ngOnInit(); + },(error) => { + console.log(error); + this.toastr.error("getting error in deleting data"); + }) + } + +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.html new file mode 100644 index 0000000..ea3a267 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.html @@ -0,0 +1,95 @@ +
+

REPORT SET UP - Project Details Report ({{ReportData.id}})

+ Edit Mode +
+
+
+
+
+
+ +
+ +
 
+
+
+ + +
+
+ + + + + + {{selected}} + + + + {{state}} + + + + + +
+
+ + + +
+ +
+
+
+
+
+ +
+
+ + +
+
+
+ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.scss new file mode 100644 index 0000000..9893e7c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.scss @@ -0,0 +1,58 @@ +// @import "../../../../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .edit-pg { + width: 750px; + } + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + #lines { + table, + th, + td { + border: 0.5px solid #f1f0f0; + border-collapse: collapse; + } + input, + input :focus { + //-webkit-appearance: none; + outline: none; + border-width: 0px; + border: none; + } + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.spec.ts new file mode 100644 index 0000000..104e81a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportBuild2editComponent } from './report-build2edit.component'; + +describe('ReportBuild2editComponent', () => { + let component: ReportBuild2editComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportBuild2editComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportBuild2editComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.ts new file mode 100644 index 0000000..7fe97f8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-build2/report-build2edit/report-build2edit.component.ts @@ -0,0 +1,159 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; + + +@Component({ + selector: 'app-report-build2edit', + templateUrl: './report-build2edit.component.html', + styleUrls: ['./report-build2edit.component.scss'] +}) +export class ReportBuild2editComponent implements OnInit { + public entryForm: FormGroup; + updated = false; + ReportData:any = {}; + id: number; + nodeEditProperties = { + std_param_html:'', + adhoc_param_html:'', + // column_str:'', + // conn_name:'', + date_param_req:'', + // folderName:'', + url:'', + +}; + constructor(private router: Router, + private route: ActivatedRoute,private reportBuilderService: ReportBuilderService, + private toastr: ToastrService, private _fb: FormBuilder) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + + this.entryForm = this._fb.group({ + std_param_html : [null], + adhoc_param_html:[null], + // column_str:[null], + // conn_name:[null], + date_param_req:[null], + // folderName:[null], + url:[null], + }); + + this.getById(this.id); + this.listoddatabase(); + } + databaselist; + listoddatabase(){ + this.reportBuilderService.getdatabse().subscribe((data)=>{ + this.databaselist=data; + console.log(this.databaselist) + },(error) => { + console.log(error); + if(error){ + } + }); + + } + builderLine; + lineId; + builderLineData:any[] = []; + getById(id: number) { + this.reportBuilderService.getrbDetailsById(id).subscribe( + (data) => { + console.log(data); + this.ReportData = data; + + + this.builderLine = this.ReportData.rpt_builder2_lines; + this.lineId = this.builderLine[0].id + console.log("line data ",this.lineId, this.builderLine); + if(this.builderLine[0].model != '') + { + this.builderLineData = JSON.parse(this.builderLine[0].model) ; + console.log(this.builderLineData); + + this.nodeEditProperties.std_param_html = this.builderLineData[0].std_param_html; + this.nodeEditProperties.adhoc_param_html = this.builderLineData[0].adhoc_param_html; + // this.nodeEditProperties.column_str = this.builderLineData.column_str; + // this.nodeEditProperties.conn_name = this.builderLineData.conn_name; + this.nodeEditProperties.date_param_req = this.builderLineData[0].date_param_req; + this.nodeEditProperties.url = this.builderLineData[0].url; + } + }, + (err) => { + console.log(err); + } + ); + } + + stdparams; + keysfromurl; + getkeys(){ + if(this.nodeEditProperties.url !== null){ + this.reportBuilderService.getcolumnDetailsByurl(this.nodeEditProperties.url).subscribe(data =>{ + console.log(data); + this.keysfromurl = data; + this.nodeEditProperties.adhoc_param_html = this.keysfromurl; + }) + }else{ + this.toastr.error("URL is required"); + } + } + + + listBuilder_Lines = { + model:{} + } + update() { + + + this.builderLineData[0] = { + std_param_html: this.nodeEditProperties.std_param_html, + adhoc_param_html: this.nodeEditProperties.adhoc_param_html, + date_param_req: this.nodeEditProperties.date_param_req, + url: this.nodeEditProperties.url, + }; + + this.builderLineData[0].std_param_html = this.nodeEditProperties.std_param_html; + this.builderLineData[0].adhoc_param_html = this.nodeEditProperties.adhoc_param_html; + // this.builderLineData.column_str = this.nodeEditProperties.column_str; + // this.builderLineData.conn_name = this.nodeEditProperties.conn_name ; + this.builderLineData[0].date_param_req = this.nodeEditProperties.date_param_req; + this.builderLineData[0].url = this.nodeEditProperties.url; + console.log(this.builderLineData); + // this.builderLineData.splice(1); + console.log(this.builderLineData); + let tmp = JSON.stringify(this.builderLineData); //.replace(/\\/g, '') + this.listBuilder_Lines.model = tmp; +console.log(this.listBuilder_Lines); + + this.reportBuilderService.updaterbLineData(this.listBuilder_Lines, this.lineId).subscribe( + (data) => { + console.log(data); + if (data) { + this.toastr.success('Update successfully'); + } + this.router.navigate(["../../all"], { relativeTo: this.route }); + //this.router.navigate(["../../all"],{ relativeTo: this.route, queryParams: { p_id: this.projectId } }); + }, + (error) => { + console.log(error); // this will come from backend + } + ); + // this.lineBuilder_Header = new Rn_Cff_ActionBuilder_Header(); + } + + onSubmit() { + this.updated = true; + this.update(); + } + + back() { + this.router.navigate(["../../all"], { relativeTo: this.route }); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.css new file mode 100644 index 0000000..b844a72 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=report-runner.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.css.map new file mode 100644 index 0000000..756b30e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"report-runner.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.spec.ts new file mode 100644 index 0000000..3f7c7ea --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportRunnerComponent } from './report-runner.component'; + +describe('ReportRunnerComponent', () => { + let component: ReportRunnerComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportRunnerComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportRunnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.ts new file mode 100644 index 0000000..1256607 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/report-runner.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-report-runner', + templateUrl: './report-runner.component.html', + styleUrls: ['./report-runner.component.scss'] +}) +export class ReportRunnerComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.css new file mode 100644 index 0000000..5c4087a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.css @@ -0,0 +1,90 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; +} + +.td-content { + text-align: left; +} + +.delete, .heading { + text-align: center; + color: red; +} + +input[type=radio] { + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; +} + +.dots { + width: 100px; + height: 100px; + bordeR: 1px solid; + border-radius: 50%; +} + +h4 { + margin-top: 16px; +} + +.s-order-dash-pg { + margin: 0px; + display: flex; + flex-wrap: wrap; + flex-direction: row; + justify-content: center; +} +.s-order-dash-pg .chart-box { + margin: 16px; + padding: 0 16px; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 2px; +} + +#word1 { + width: 190px; + height: 180px; +} + +.center { + text-align: center; + margin-top: 5px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.heading { + text-align: center; + color: red; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +}/*# sourceMappingURL=reportrunnerall.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.css.map new file mode 100644 index 0000000..b30f804 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["reportrunnerall.component.scss","reportrunnerall.component.css"],"names":[],"mappings":"AAAA;EACI,iBAAA;EACA,YAAA;EACA,iBAAA;EACA,2CAAA;EACA,YAAA;ACCJ;;ADCE;EACE,gBAAA;ACEJ;;ADAE;EACE,kBAAA;EACA,UAAA;ACGJ;;ADDE;EACE,sBAAA;EACA,uBAAA;EACA,WAAA;EACA,wBAAA;EACA,qBAAA;EACA,mBAAA;EACA,gBAAA;EACA,uBAAA;EACA,gBAAA;EACA,gBAAA;EACA,kBAAA;EACA,gBAAA;EACA,eAAA;ACIJ;;ADFE;EAEE,YAAA;EACA,aAAA;EACA,iBAAA;EACA,kBAAA;ACIJ;;ADDI;EAAG,gBAAA;ACKP;;ADJI;EACE,WAAA;EACA,aAAA;EACA,eAAA;EACA,mBAAA;EACA,uBAAA;ACON;ADNM;EACE,YAAA;EACA,eAAA;EACA,sBAAA;EACA,sBAAA;EACA,kBAAA;ACQR;;ADLI;EACC,YAAA;EACC,aAAA;ACQN;;ADLI;EACE,kBAAA;EACA,eAAA;ACQN;;ADLI;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACQN;;ADNM;EACE,kBAAA;EACA,UAAA;ACSR;;ADNM;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACSR","file":"reportrunnerall.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.html new file mode 100644 index 0000000..8b8f5ff --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.html @@ -0,0 +1,109 @@ + +
+ + +
+
+
+

{{ 'ALL_REPORT' | translate }}

+
+
+ + +
+
+ + + + + + + + +
+
+
+
+
+
+
+
+ + {{ 'SQL' | translate }}items in a light blue badge + {{ 'URL' | translate }}items in an orange badge +
+
+ +
+
+
+
+ {{app.reportName}} +
+
+ +
+
+ {{app.description}} +
+
+
+ + +
+ + + + +
+
+
+
+
+ + + + +
+ + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.scss new file mode 100644 index 0000000..48905e0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.scss @@ -0,0 +1,93 @@ +.td-title { + text-align: right; + width: 150px; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + color: white; + } + .td-content{ + text-align: left; + } + .delete,.heading{ + text-align: center; + color: red; + } + input[type='radio']{ + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; + } + .dots + { + width: 100px; + height:100px; + border: 1px solid; + border-radius: 50%; + //background-color: #f00; + } + h4{margin-top: 16px;} + .s-order-dash-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + } + } + #word1{ + width: 190px; + height: 180px; + + } + .center{ + text-align: center; + margin-top: 5px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + .heading{ + text-align: center; + color: red; + } + + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + + + #word { + display: inline-block; + width: 320px; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + font-weight: bold; + + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.spec.ts new file mode 100644 index 0000000..3887e78 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportrunnerallComponent } from './reportrunnerall.component'; + +describe('ReportrunnerallComponent', () => { + let component: ReportrunnerallComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportrunnerallComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportrunnerallComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.ts new file mode 100644 index 0000000..c4bfbb1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunnerall/reportrunnerall.component.ts @@ -0,0 +1,90 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; +import { ToastrService } from 'ngx-toastr'; + +@Component({ + selector: 'app-reportrunnerall', + templateUrl: './reportrunnerall.component.html', + styleUrls: ['./reportrunnerall.component.scss'] +}) +export class ReportrunnerallComponent implements OnInit { + gridData; + loading = false; + error; + selected: any[] = []; + rowSelected :any= {}; + modaldelete=false; + isLoading: boolean = false; + projectId; + moduleId; + projectname; + constructor(private router: Router, + private route: ActivatedRoute,private reportBuilderService: ReportBuilderService, + private toastr:ToastrService, ) { } + + ngOnInit(): void { + + this.getAll(); + } + + + getAll() { + this.isLoading = true; + this.reportBuilderService.getrbDetails().subscribe((data) => { + this.isLoading = false; + console.log(data); + this.gridData = data; + if(this.gridData.length == 0){ + this.error="No data Available"; + console.log(this.error); + } + }); + } + + goToAdd2() { + this.router.navigate(["../../reportbuild2/"], { relativeTo: this.route, }); + } + + goToAdd() { + this.router.navigate(["../../reportbuild/"], { relativeTo: this.route, }); + } + + goToEdit(id: number) { + this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + goToRunner(user) { + const id = user.id; + const isSql = user.isSql; + if(isSql == true) { + this.router.navigate(["../runner/" + id], { relativeTo: this.route, }); + }else if(isSql == false){ + this.router.navigate(["../runner2/" + id], { relativeTo: this.route, }); + } + + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id){ + this.modaldelete = false; + this.reportBuilderService.deletrbById(id).subscribe((data) => { + console.log(data); + if(data || data == null || data.status >= 200 && data.status <= 209){ + this.toastr.success("Deleted successfully"); + } + this.ngOnInit(); + },(error) => { + console.log(error); + this.toastr.error("getting error in deleting data"); + }) + } + + gotoAction(){ + this.router.navigate(["../../actions"], { relativeTo: this.route, queryParams: { m_id: this.moduleId,pname:this.projectname } }); + } + gotoRepo(){ + this.router.navigate(["../../modulecard"], { relativeTo: this.route, queryParams: { p_id: this.projectId } }); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.css b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.css new file mode 100644 index 0000000..dae91f0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.css @@ -0,0 +1,76 @@ +input[type=text], [type=date], [type=password] { + width: 100%; + padding: 15px 20px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + padding: 10px; + font-size: 18px; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.35rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +input[type=text], textarea { + width: 100%; + padding: 15px 15px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.required-field { + color: red; +} + +.postColumn { + border: 1px solid #ccc; + width: 78%; + margin-left: 15px; +} + +.colName { + text-align: center; + padding: 5px; +} + +.colfields { + border: 1px solid black; + margin: 17px; + text-align: center; + padding: 3px; +} + +.fieldWrapper { + margin-top: 20px; +} + +.center { + text-align: center; +}/*# sourceMappingURL=reportrunneredit.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.css.map new file mode 100644 index 0000000..4d6ee07 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["reportrunneredit.component.scss","reportrunneredit.component.css"],"names":[],"mappings":"AAAA;EACI,WAAA;EACA,kBAAA;EAED,oCAAA;EACC,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACAJ;;ADEE;EACE,yBAAA;EACA,YAAA;ACCJ;;ADCE;EAEE,aAAA;EACA,eAAA;ACCJ;;ADCE;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACEJ;;ADCE;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACEJ;;ADAE;EACE,WAAA;EACA,kBAAA;EAED,oCAAA;EACC,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACEJ;;ADAE;EACE,UAAA;ACGJ;;ADAE;EACE,sBAAA;EACA,UAAA;EACA,iBAAA;ACGJ;;ADDE;EACE,kBAAA;EACA,YAAA;ACIJ;;ADFE;EACE,uBAAA;EACA,YAAA;EACA,kBAAA;EACA,YAAA;ACKJ;;ADHE;EACE,gBAAA;ACMJ;;ADJE;EACE,kBAAA;ACOJ","file":"reportrunneredit.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.html new file mode 100644 index 0000000..8d778b1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.html @@ -0,0 +1,266 @@ + +

Report Name - {{reportName}}

+
+
+
+
+
Date Range
+
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+
Standard Parameters
+ +
+
+
+ + + + + +
+
+
+ +
+
+
+
+
+
Adhoc Parameters
+
+
+
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + +
+
+
+
+
+ + +
+
+

Report Output

+
+
+ + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + +
{{co}}
+ + + {{ formatDate(item[key]) }} + + + {{ item[key] }} + +
+
+ + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.scss new file mode 100644 index 0000000..2075896 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.scss @@ -0,0 +1,80 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} + +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +$bg-color: #dddddd; + +.section { + background-color: $bg-color; + height: 40px; +} + +.section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +input[type=text],[type=password],[type=date],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.required-field{ + color: red; + +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.spec.ts new file mode 100644 index 0000000..6563a07 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportrunnereditComponent } from './reportrunneredit.component'; + +describe('ReportrunnereditComponent', () => { + let component: ReportrunnereditComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ReportrunnereditComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportrunnereditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.ts new file mode 100644 index 0000000..ac51541 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit/reportrunneredit.component.ts @@ -0,0 +1,611 @@ +import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { DomSanitizer } from '@angular/platform-browser'; +import { ActivatedRoute, Router } from '@angular/router'; +import * as moment from 'moment'; +import { ToastrService } from 'ngx-toastr'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; +import { ExcelService } from 'src/app/services/excel.service'; +import { saveAs } from 'file-saver'; +@Component({ + selector: 'app-reportrunneredit', + templateUrl: './reportrunneredit.component.html', + styleUrls: ['./reportrunneredit.component.scss'], + encapsulation: ViewEncapsulation.None +}) +export class ReportrunnereditComponent implements OnInit { + dynamicForm: FormGroup; + modalselect:boolean=false; + serverData = [{"andor": "AND", + "fields_name": "", + "condition": "=", + "value": ""}]; + andor = ['AND', 'OR','NOT']; + fieldname = ['name1', 'name2']; + condition = ['=','!=','<','>','<=','>=','LIKE','BETWEEN','IN']; + header_id; + public array=[ + { + "id": 1, + "name": "Jack", + "fromDate": "19-05-2023", + "toDate": "03-06-2023" + }, + { + "id": 2, + "name": "Allen", + "fromDate": "18-05-2023", + "toDate": "12-08-2023" + }, + { + "id": 3, + "name": "Annie", + "fromDate": "11-05-2023",//2023-11-05 + "toDate": "19-05-2023" + }, + { + "id": 4, + "name": "ashok", + "fromDate": "08-05-2023", + "toDate": "02-02-2023" + }, + { + "id": 5, + "name": "Anu", + "fromDate": "29-11-2020", + "toDate": "01-06-2021" + }, + { + "id": 6, + "name": "thrymr", + "fromDate": "04-04-2023", + "toDate": "15-05-2023" + }, + { + "id": 7, + "name": "Ab", + "fromDate": "29-11-2022", + "toDate": "01-06-2023" + }, + { + "id": 8, + "name": "thakur", + "fromDate": "04-04-2022", + "toDate": "15-05-2022" + } + ] + selectedfrom; + selectedto; + constructor(private router: Router, + private route: ActivatedRoute,private _fb: FormBuilder, + private reportBuilderService: ReportBuilderService,private toastr:ToastrService,private sanitizer: DomSanitizer,private excel: ExcelService) + { + this.dynamicForm = this._fb.group({ + }); + } +todayDate; + ngOnInit(): void { + this.todayDate = new Date().toISOString().slice(0, 10); + this.header_id = this.route.snapshot.params["id"]; + console.log(" id = ", this.header_id); + // this.duplicateArray=this.array; + this.getById(this.header_id); + + this.select('Today') + setTimeout(() => { + this.runtheQuery(); + }, 2000); + + + } + reportName; + builderLine; + builderLineData; + lineId; + adhocList; + SQLQuery; + stdParamfields; + date_param_req; + getById(id: number) { + this.reportBuilderService.getrbDetailsById(id).subscribe( + (data) => { + console.log(data); + this.reportName = data.reportName; + this.builderLine = data.rpt_builder2_lines; + this.lineId = this.builderLine[0].id + this.builderLineData = JSON.parse(this.builderLine[0].model) ; + console.log(this.lineId,this.builderLineData); + const adhocList = this.builderLineData.adhoc_param_html; + this.adhocList = JSON.parse(adhocList); + console.log(this.adhocList) + this.date_param_req = this.builderLineData.date_param_req; + this.SQLQuery = this.builderLineData.sql_str; + this.getStdParam(this.header_id); + }); + + } + + dynamicHtml:any = []; + dynamicHtmlFlag = false; + stdParmas; + stdParamFlag = false; + getStdParam(id: any){ + console.log(this.builderLineData.std_param_html); + this.dynamicHtml = JSON.parse(this.builderLineData.std_param_html); + // this.dynamicHtml = ['a.abc','b.abcde'] + if (this.dynamicHtml) { + for (const field of this.dynamicHtml) { + if (!this.dynamicForm.get(field)) { + this.dynamicForm.addControl(field, this._fb.control(null)); + } + } + console.log(this.dynamicForm.value); + } + if(this.dynamicHtml == undefined || this.dynamicHtml == ''){ + this.dynamicHtmlFlag = false; + }else{ + this.dynamicHtmlFlag = true; + } + + // this.reportBuilderService.getStdParamById(id).subscribe(data => { + // console.log(data); + // this.stdParmas = data; + // },(error)=>{ + // console.log(error.error.text) + // this.stdParmas = this.sanitizer.bypassSecurityTrustHtml(error.error.text); + + // if(this.stdParmas == undefined || this.stdParmas == ''){ + // this.stdParamFlag = false; + // }else{ + // this.stdParamFlag = true; + // } + // }); + } + modo2(val){ + console.log(val); + this.selectedfrom=val; + } + modo3(val){ + console.log(val); +this.selectedto=val; + } + duplicateArray=[]; + myDateValue: Date; + toDate:Date; + reverseAndTimeStamp(dateString) { + const reverse = new Date(dateString.split("-").reverse().join("-")); + return reverse.getTime(); + } + filterDate() { + let fromdate=moment(this.myDateValue).format('DD-MM-YYYY'); +console.log(fromdate) +let todate=moment(this.toDate).format('DD-MM-YYYY'); +if(this.myDateValue && this.toDate){ +const selectedMembers = this.array.filter(m => { + return this.reverseAndTimeStamp(m.fromDate) >= this.reverseAndTimeStamp(fromdate) && this.reverseAndTimeStamp(m.fromDate) <= this.reverseAndTimeStamp(todate) + } + ); + this.duplicateArray=selectedMembers +}else{ +this.duplicateArray=this.array +} + console.log(this.duplicateArray); // the result objects + this.modalselect=false; +} + + dateParameter: string; + from_date: Date; + to_date: Date; + + calculateThisWeek(): void { + // Calculate the current date + const currentDate = new Date(); + console.log(currentDate) + // Get the day of the week (0-6, where 0 is Sunday) + const currentDayOfWeek = currentDate.getDay(); + + // Calculate the number of days to subtract to get to Monday + const daysToMonday = currentDayOfWeek === 0 ? 6 : currentDayOfWeek - 1; + + // Calculate the date of Monday of the current week + this.from_date = new Date(currentDate); + this.from_date.setDate(currentDate.getDate() - daysToMonday); + + // Calculate the date of Sunday of the current week + this.to_date = new Date(this.from_date); + this.to_date.setDate(this.from_date.getDate() + 6); + console.log(this.from_date); + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + calculateLastWeek(): void { + // Calculate the current date + const currentDate = new Date(); + + // Get the day of the week (0-6, where 0 is Sunday) + const currentDayOfWeek = currentDate.getDay(); + + // Calculate the number of days to subtract to get to Monday + const daysToMonday = currentDayOfWeek === 0 ? 6 : currentDayOfWeek - 1; + + // Calculate the date of Monday of the previous week + this.from_date = new Date(currentDate); + this.from_date.setDate(currentDate.getDate() - daysToMonday - 7); + + // Calculate the date of Sunday of the previous week + this.to_date = new Date(this.from_date); + this.to_date.setDate(this.from_date.getDate() + 6); + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + calculateThisMonth(): void { + // Calculate the current date + const currentDate = new Date(); + + // Calculate the date of the first day of the current month + this.from_date = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1); + + // Calculate the date of the last day of the current month + this.to_date = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0); + + this.to_date.setDate(this.from_date.getDate() + 6); + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=currentDate; + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + + calculateLastMonth(): void { + // Calculate the current date + const currentDate = new Date(); + + // Calculate the date of the first day of the previous month + this.from_date = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1); + + // Calculate the date of the last day of the previous month + this.to_date = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0); + + this.to_date.setDate(this.from_date.getDate() + 6); + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + calculateThisYear(): void { + // Calculate the current date + const currentDate = new Date(); + + // Calculate the date of the first day of the current year + this.from_date = new Date(currentDate.getFullYear(), 0, 1); + + // Calculate the date of the last day of the current year + this.to_date = new Date(currentDate.getFullYear(), 11, 31); + + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + + calculateLastYear(): void { + // Calculate the current date + const currentDate = new Date(); + + // Calculate the date of the first day of the previous year + this.from_date = new Date(currentDate.getFullYear() - 1, 0, 1); + + // Calculate the date of the last day of the previous year + this.to_date = new Date(currentDate.getFullYear() - 1, 11, 31); + + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + SelectdateType; + select(val:any){ + console.log(val); + this.SelectdateType = val; + if(val === 'This Week'){ + this.calculateThisWeek() + }else if(val === 'Last Week'){ + this.calculateLastWeek() + }else if(val === 'This Month'){ + this.calculateThisMonth() + }else if(val === 'Last Month'){ + this.calculateLastMonth() + // }else if(val === 'To Specific FromDate To To Date'){ + // this.openmodel() + } + else if(val === 'This Year'){ + this.calculateThisYear() + }else if(val === 'Last Year'){ + this.calculateLastYear() + } + else if(val === 'Today'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.myDateValue = this.todayDate; + this.toDate = this.todayDate; + + this.FromDatequery = this.myDateValue; + this.ToDatequery = this.toDate; + } + else if(val === ''){ + this.myDateValue = null; + this.toDate = null; + this.FromDatequery = null; + this.ToDatequery = null; + } + + + } + openmodel(){ + this.modalselect=true; + } + + onExport() { + const reportNameWithUnderscore = this.reportName + '_'; + this.excel.exportAsExcelFile(this.rows, reportNameWithUnderscore, + moment().format('YYYYMMDD_HHmmss')) + } + + downloadFile(format: string) { + const date = moment().format('YYYYMMDD_HHmmss') + const reportNameWithUnderscore = this.reportName + '_' + date; + this.reportBuilderService.downloadFile(format, this.rows,reportNameWithUnderscore) + // this.reportBuilderService.downloadFile(format, this.rows).subscribe( + // (data) => { + // // Handle the file data received from the service + // const blob = new Blob([data], { type: 'application/octet-stream' }); + // const reportNameWithUnderscore = this.reportName + '_'; + // saveAs(blob, `${reportNameWithUnderscore}.${format}`); // Save the file using file-saver library + // }, + // (error) => { + // console.error('File download failed:', error); + // const date = moment().format('YYYYMMDD_HHmmss') + // const reportNameWithUnderscore = this.reportName + '_' + date; + // if (format === 'csv') { + // const blob = new Blob([error.error.text], { type: 'text/csv' }); + // saveAs(blob, `${reportNameWithUnderscore}.csv`); + // } else if (format === 'pdf') { + // const blob = new Blob([error.error.text], { type: 'application/pdf' }); + // saveAs(blob,`${reportNameWithUnderscore}.pdf`); + // // const pdf = new jsPDF(); + // // pdf.text(error.error.text, 10, 10); // Assuming 'data' is the PDF content, adjust as needed + + // // pdf.save(`${reportNameWithUnderscore}.pdf`); + // } + // }); + } + back(){ + this.router.navigate(["../../all"], { relativeTo: this.route }); + } +FormattedAdhocparameters; +adocdata; +// showPlusIconRow: number | null = 0; + onAddLines(){ + console.log(this.serverData); + const lastRow = this.serverData[this.serverData.length - 1]; + if (lastRow && lastRow.fields_name !== '') { + let formattedString = ''; + for (const condition of this.serverData) { + const { andor, fields_name, condition: cond, value } = condition; + formattedString += ` ${andor} ${fields_name} ${cond} '${value}' `; + // console.log(formattedString); + this.FormattedAdhocparameters = formattedString + } + this.serverData.push({ + andor: "AND", + fields_name: "", + condition: "=", + value: "" + }); + } + // this.showPlusIconRow = this.serverData.length - 1; + + } + deleteRow(index) { + // this.serverData.splice(index, 1); + // if (index === this.showPlusIconRow) { + // this.showPlusIconRow = null; + // } + if (this.serverData.length > 1) { + this.serverData.splice(index, 1); + } + } + + + rows:any[]; + columns: any[]; + rowdata; + FromDatequery; + ToDatequery; + + newfrom; + newto; + + dateKey; +runtheQuery(){ + console.log(this.dynamicForm.value); + console.log(this.myDateValue , this.toDate); + console.log(this.SQLQuery); + let query = this.SQLQuery; +// let query + if(this.dynamicForm.value){ + // for(let i = 0; i < this.dynamicForm.value.length; i++){ + // // const query = this.SQLQuery + " AND " + this.dynamicForm.controls[i] + " = " + this.dynamicForm.value[i] + + // } + + + // Iterate over the keys in dynamicForm.value + Object.keys(this.dynamicForm.value).forEach((key) => { + // Append the condition for each key to the query + if (this.dynamicForm.value[key] !== null && this.dynamicForm.value[key] !== '') { + query += ` AND ${key} = '${this.dynamicForm.value[key]}'`; + } + // const regex = /FROM/i; + // const match = query.match(regex); + // if (this.dynamicForm.value[key] !== null && this.dynamicForm.value[key] !== '') { + // // query += ` AND ${key} = '${this.dynamicForm.value[key]}'`; + // const columnName = key.split('.').pop(); + // let coalesceExpression = `, COALESCE(${key}, '${this.dynamicForm.value[key]}') as ${columnName}`; + // if (match) { + // // Insert the COALESCE expression before the FROM keyword + // query = query.slice(0, match.index) + coalesceExpression +' '+ query.slice(match.index); + // } + // } + }); + if(this.date_param_req == 'Yes'){ + this.dateKey = 'createdat'; + this.adhocList.forEach(key => { + if (key.includes("a.created_at")) { + this.dateKey ="created_at" ; + } + }); + this.adhocList.forEach(key => { + if (key.includes("a.createdAt")) { + this.dateKey ="createdAt" ; + } +}); +// if (this.adhocList.includes('created_at')) { +// dateKey = 'created_at'; +// } + + if(this.FromDatequery && this.ToDatequery){ + query += ` AND ${this.dateKey} BETWEEN '${this.FromDatequery}' AND '${this.ToDatequery}'`; + + }else if(this.myDateValue && this.toDate){ + if(this.myDateValue){ + const inputDate = new Date(this.myDateValue); + const year = inputDate.getFullYear(); + const month = String(inputDate.getMonth() + 1).padStart(2, "0"); // Months are zero-based, so add 1 + const day = String(inputDate.getDate()).padStart(2, "0"); + this.newfrom = `${year}-${month}-${day}`; + } + if(this.toDate){ + const inputDate = new Date(this.toDate); + const year = inputDate.getFullYear(); + const month = String(inputDate.getMonth() + 1).padStart(2, "0"); // Months are zero-based, so add 1 + const day = String(inputDate.getDate()).padStart(2, "0"); + this.newto = `${year}-${month}-${day}`; + + } + query += ` AND ${this.dateKey} BETWEEN '${this.newfrom}' AND '${this.newto}'`; + +} + } + // `SELECT * FROM abc where cretaedat BETWEEN '2023-04-04' AND '2023-05-19';` + `COALESCE(b.description, 'checking') as description` + // if(this.myDateValue && this.toDate){ + // query += ` AND from_date = NVL(${this.myDateValue}from_date, 'from_date') AND to_date = NVL(${this.toDate}to_date, 'to_date')`; + // } + console.log(query); + } + if(this.FormattedAdhocparameters){ + query += this.FormattedAdhocparameters + } +// query = `SELECT a.name AS name, b.dob AS dob FROM abc a, abcde b WHERE a.name = 'gaurav' AND a.abc = NVL(b.abc, 'name') AND a.abcde = NVL(b.abcde, 'test');` + console.log(query); + this.reportBuilderService.getMasterData(query).subscribe((data) => { + this.rows = data; + console.log(this.rows); +this.rowdata= [this.rows]; + console.log(typeof this.rows); + if(data){ + this.toastr.success("Run Successfully") + } + var j; + var cart = []; + + for(var i = 0; i < data.length; i++) + { + var columnsIn = data[i]; + if(i==1) + { + for(var key in columnsIn) + { + j={prop:key , name: key}; + cart.push(j) + + } + } + } + this.columns = cart; + +}); +// if(this.FromDatequery && this.ToDatequery){ +// this.FromDatequery = null; +// this.ToDatequery = null; +// }else if(this.myDateValue && this.toDate){ +// this.newfrom = null; +// this.toDate = null; +// } +} +getHeaders() { +let headers: string[] = []; +if(this.rows) { + this.rows.forEach((value) => { + Object.keys(value).forEach((key) => { + if(!headers.find((header) => header == key)){ + headers.push(key) + } + + }) + + }) +} +return headers; +} + +formatDate(dateObj: any): string { + // Extract individual date properties + const { year, monthValue, dayOfMonth, hour, minute, second } = dateObj; + + // Create a JavaScript Date object using the extracted properties + const formattedDate = new Date(year, monthValue - 1, dayOfMonth, hour, minute, second); + + // Format the date as needed (e.g., using built-in JavaScript date formatting) + return formattedDate.toLocaleString(); // Or any other desired formatting +} + +isDate(value: any): boolean { + return ( + value instanceof Date || + (value && + value.year !== undefined && + value.monthValue !== undefined && + value.dayOfMonth !== undefined) + ); +} + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.html new file mode 100644 index 0000000..3fc204b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.html @@ -0,0 +1,305 @@ + +

Report Name - {{reportName}}

+
+
+
+
+
Date Range
+
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+
Standard Parameters
+ +
+
+
+ + + + +
+
+
+ +
+
+
+
+
+
Adhoc Parameters
+
+
+
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + +
+
+
+
+
+ + +
+
+

Report Output

+
+
+ + + + + + + + + + + + +
+
+
+
+ + + + + + + + + + + +
{{co}}
+ + + {{ item[key] }} + + + + {{ item[key] | date:'medium' }} + +
+
+
+ + + + + + + + + + + +
{{co}}
+ + + {{ item[key] }} + + + + {{ item[key] | date:'medium' }} + + + + +
+
+ + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.scss new file mode 100644 index 0000000..008d21a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.scss @@ -0,0 +1,81 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=password],[type=date],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.spec.ts new file mode 100644 index 0000000..e22611d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Reportrunneredit2Component } from './reportrunneredit2.component'; + +describe('Reportrunneredit2Component', () => { + let component: Reportrunneredit2Component; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ Reportrunneredit2Component ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(Reportrunneredit2Component); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.ts new file mode 100644 index 0000000..1f78b64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/report-runner/reportrunneredit2/reportrunneredit2.component.ts @@ -0,0 +1,831 @@ +import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { DomSanitizer } from '@angular/platform-browser'; +import { ActivatedRoute, Router } from '@angular/router'; +import * as moment from 'moment'; +import { ToastrService } from 'ngx-toastr'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; +import { ExcelService } from 'src/app/services/excel.service'; + +@Component({ + selector: 'app-reportrunneredit2', + templateUrl: './reportrunneredit2.component.html', + styleUrls: ['./reportrunneredit2.component.scss'] +}) +export class Reportrunneredit2Component implements OnInit { + dynamicForm: FormGroup; + modalselect:boolean=false; + serverData = [{"andor": "AND", + "fields_name": "", + "condition": "=", + "value": ""}]; + andor = ['AND', 'OR','NOT']; + fieldname = ['name1', 'name2']; + condition = ['=','!=','<','>','<=','>=','LIKE','BETWEEN','IN']; + header_id; + public array=[ + { + "id": 1, + "name": "Jack", + "fromDate": "19-05-2023", + "toDate": "03-06-2023" + }, + { + "id": 2, + "name": "Allen", + "fromDate": "18-05-2023", + "toDate": "12-08-2023" + }, + { + "id": 3, + "name": "Annie", + "fromDate": "11-05-2023",//2023-11-05 + "toDate": "19-05-2023" + }, + { + "id": 4, + "name": "ashok", + "fromDate": "08-05-2023", + "toDate": "02-02-2023" + }, + { + "id": 5, + "name": "Anu", + "fromDate": "29-11-2020", + "toDate": "01-06-2021" + }, + { + "id": 6, + "name": "thrymr", + "fromDate": "04-04-2023", + "toDate": "15-05-2023" + }, + { + "id": 7, + "name": "Ab", + "fromDate": "29-11-2022", + "toDate": "01-06-2023" + }, + { + "id": 8, + "name": "thakur", + "fromDate": "04-04-2022", + "toDate": "15-05-2022" + } + ] + selectedfrom; + selectedto; + constructor(private router: Router, + private route: ActivatedRoute,private _fb: FormBuilder, + private reportBuilderService: ReportBuilderService,private toastr:ToastrService,private sanitizer: DomSanitizer,private excel: ExcelService) + { + this.dynamicForm = this._fb.group({ + }); + } +todayDate; + ngOnInit(): void { + this.todayDate = new Date().toISOString().slice(0, 10); + this.header_id = this.route.snapshot.params["id"]; + console.log(" id = ", this.header_id); + // this.duplicateArray=this.array; + this.getById(this.header_id); + + this.select('Today') + setTimeout(() => { + this.runtheQuery(); + }, 2000); + + + } + reportName; + builderLine; + builderLineData; + lineId; + adhocList:any[]; + SQLQuery; + getUrl; + stdParamfields; + DateParam; + getById(id: number) { + this.reportBuilderService.getrbDetailsById(id).subscribe( + (data) => { + console.log(data); + this.reportName = data.reportName; + this.builderLine = data.rpt_builder2_lines; + this.lineId = this.builderLine[0].id + this.builderLineData = JSON.parse(this.builderLine[0].model) ; + console.log(this.lineId,this.builderLineData); + this.builderLineData = this.builderLineData[0]; + this.adhocList = this.builderLineData.adhoc_param_html; + // this.adhocList = JSON.parse(adhocList); + this.DateParam = this.builderLineData.date_param_req; + this.getUrl = this.builderLineData.url; + console.log(this.adhocList,this.DateParam,this.getUrl) + this.getStdParam(this.header_id); + this.featchData(); + }); + + } + + featchData(){ + this.reportBuilderService.getAllDetailsByurl(this.getUrl).subscribe(data =>{ + console.log(data); + if(data.body){ + console.log(JSON.parse(data.body)); + this.rows = JSON.parse(data.body); + this.filterRows = JSON.parse(data.body); + } + }); + } + + dynamicHtml:any = []; + dynamicHtmlFlag = false; + stdParmas; + stdParamFlag = false; + getStdParam(id: any){ + console.log(this.builderLineData.std_param_html); + this.dynamicHtml = this.builderLineData.std_param_html; + // this.dynamicHtml = ['a.abc','b.abcde'] + if (this.dynamicHtml) { + for (const field of this.dynamicHtml) { + if (!this.dynamicForm.get(field)) { + this.dynamicForm.addControl(field, this._fb.control(null)); + } + } + console.log(this.dynamicForm.value); + } + if(this.dynamicHtml == undefined || this.dynamicHtml == ''){ + this.dynamicHtmlFlag = false; + }else{ + this.dynamicHtmlFlag = true; + } + + // this.reportBuilderService.getStdParamById(id).subscribe(data => { + // console.log(data); + // this.stdParmas = data; + // },(error)=>{ + // console.log(error.error.text) + // this.stdParmas = this.sanitizer.bypassSecurityTrustHtml(error.error.text); + + // if(this.stdParmas == undefined || this.stdParmas == ''){ + // this.stdParamFlag = false; + // }else{ + // this.stdParamFlag = true; + // } + // }); + } + modo2(val){ + console.log(val); + this.selectedfrom=val; + } + modo3(val){ + console.log(val); +this.selectedto=val; + } + duplicateArray=[]; + myDateValue: Date; + toDate:Date; + reverseAndTimeStamp(dateString) { + const reverse = new Date(dateString.split("-").reverse().join("-")); + return reverse.getTime(); + } + filterDate() { + let fromdate=moment(this.myDateValue).format('DD-MM-YYYY'); +console.log(fromdate) +let todate=moment(this.toDate).format('DD-MM-YYYY'); +if(this.myDateValue && this.toDate){ +const selectedMembers = this.array.filter(m => { + return this.reverseAndTimeStamp(m.fromDate) >= this.reverseAndTimeStamp(fromdate) && this.reverseAndTimeStamp(m.fromDate) <= this.reverseAndTimeStamp(todate) + } + ); + this.duplicateArray=selectedMembers +}else{ +this.duplicateArray=this.array +} + console.log(this.duplicateArray); // the result objects + this.modalselect=false; +} + + dateParameter: string; + from_date: Date; + to_date: Date; + + calculateThisWeek(): void { + // Calculate the current date + const currentDate = new Date(); + console.log(currentDate) + // Get the day of the week (0-6, where 0 is Sunday) + const currentDayOfWeek = currentDate.getDay(); + + // Calculate the number of days to subtract to get to Monday + const daysToMonday = currentDayOfWeek === 0 ? 6 : currentDayOfWeek - 1; + + // Calculate the date of Monday of the current week + this.from_date = new Date(currentDate); + this.from_date.setDate(currentDate.getDate() - daysToMonday); + + // Calculate the date of Sunday of the current week + this.to_date = new Date(this.from_date); + this.to_date.setDate(this.from_date.getDate() + 6); + console.log(this.from_date); + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + calculateLastWeek(): void { + // Calculate the current date + const currentDate = new Date(); + + // Get the day of the week (0-6, where 0 is Sunday) + const currentDayOfWeek = currentDate.getDay(); + + // Calculate the number of days to subtract to get to Monday + const daysToMonday = currentDayOfWeek === 0 ? 6 : currentDayOfWeek - 1; + + // Calculate the date of Monday of the previous week + this.from_date = new Date(currentDate); + this.from_date.setDate(currentDate.getDate() - daysToMonday - 7); + + // Calculate the date of Sunday of the previous week + this.to_date = new Date(this.from_date); + this.to_date.setDate(this.from_date.getDate() + 6); + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + calculateThisMonth(): void { + // Calculate the current date + const currentDate = new Date(); + + // Calculate the date of the first day of the current month + this.from_date = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1); + + // Calculate the date of the last day of the current month + this.to_date = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0); + + // Set the 'to_date' to the last day of the current month at the end of the day + this.to_date.setHours(23, 59, 59, 999); + + // Optionally, you can set 'myDateValue' to 'from_date' if needed + this.myDateValue = this.from_date; + + // Optionally, you can set 'toDate' to 'to_date' if needed + this.toDate = this.to_date; + + console.log(this.from_date); + console.log(this.to_date); + + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + } + + + calculateLastMonth(): void { + // Calculate the current date + const currentDate = new Date(); + + // Calculate the date of the first day of the previous month + this.from_date = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1); + + // Calculate the date of the last day of the previous month + this.to_date = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0); + + // Set the 'to_date' to the last day of the previous month at the end of the day + this.to_date.setHours(23, 59, 59, 999); + + // Optionally, you can set 'myDateValue' to 'from_date' if needed + this.myDateValue = this.from_date; + + // Optionally, you can set 'toDate' to 'to_date' if needed + this.toDate = this.to_date; + + console.log(this.from_date); + console.log(this.to_date); + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + } + + calculateThisYear(): void { + // Calculate the current date + const currentDate = new Date(); + + // Calculate the date of the first day of the current year + this.from_date = new Date(currentDate.getFullYear(), 0, 1); + + // Calculate the date of the last day of the current year + this.to_date = new Date(currentDate.getFullYear(), 11, 31); + + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + + calculateLastYear(): void { + // Calculate the current date + const currentDate = new Date(); + + // Calculate the date of the first day of the previous year + this.from_date = new Date(currentDate.getFullYear() - 1, 0, 1); + + // Calculate the date of the last day of the previous year + this.to_date = new Date(currentDate.getFullYear() - 1, 11, 31); + + this.myDateValue=this.from_date; + console.log(this.to_date); + console.log(this.myDateValue); + this.toDate=this.to_date; + + this.FromDatequery = this.from_date.toISOString().substring(0, 10); + this.ToDatequery = this.to_date.toISOString().substring(0, 10); + // this.filterDate(); + } + SelectdateType; + select(val:any){ + console.log(val); + this.SelectdateType = val; + if(val === 'This Week'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.calculateThisWeek() + }else if(val === 'Last Week'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.calculateLastWeek() + }else if(val === 'This Month'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.calculateThisMonth() + }else if(val === 'Last Month'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.calculateLastMonth() + // }else if(val === 'To Specific FromDate To To Date'){ + // this.openmodel() + } + else if(val === 'This Year'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.calculateThisYear() + }else if(val === 'Last Year'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.calculateLastYear() + } + else if(val === 'Today'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.myDateValue = this.todayDate; + this.toDate = this.todayDate; + + this.FromDatequery = this.myDateValue; + this.ToDatequery = this.toDate; + } + else if(val === '--Select Particular--'){ + this.FromDatequery = null; + this.ToDatequery = null; + this.newfrom = null; + this.newto = null; + this.myDateValue = null; + this.toDate = null; + } + + + } + openmodel(){ + this.modalselect=true; + } + + onExport() { + const reportNameWithUnderscore = this.reportName + '_'; + this.excel.exportAsExcelFile(this.rows, reportNameWithUnderscore, + moment().format('YYYYMMDD_HHmmss')) + } + + downloadFile(format: string) { + const date = moment().format('YYYYMMDD_HHmmss') + const reportNameWithUnderscore = this.reportName + '_' + date; + this.reportBuilderService.downloadFile(format, this.filterRows,reportNameWithUnderscore) + } + back(){ + this.router.navigate(["../../all"], { relativeTo: this.route }); + } +FormattedAdhocparameters; +adocdata; +// showPlusIconRow: number | null = 0; + onAddLines(){ + console.log(this.serverData); + const lastRow = this.serverData[this.serverData.length - 1]; + if (lastRow && lastRow.fields_name !== '') { + let formattedString = ''; + for (const condition of this.serverData) { + const { andor, fields_name, condition: cond, value } = condition; + formattedString += ` ${andor} ${fields_name} ${cond} '${value}' `; + console.log(formattedString); + this.FormattedAdhocparameters = formattedString + // this.selectcolumn(this.serverData); + } + this.serverData.push({ + andor: "AND", + fields_name: "", + condition: "=", + value: "" + }); + } + // this.showPlusIconRow = this.serverData.length - 1; + + } + deleteRow(index) { + // this.serverData.splice(index, 1); + // if (index === this.showPlusIconRow) { + // this.showPlusIconRow = null; + // } + if (this.serverData.length > 1) { + // Get the item to be deleted + const deletedItem = this.serverData[index]; + + // Remove the item from the serverData array + this.serverData.splice(index, 1); + + // Remove the corresponding entries from selectedValues + if (Array.isArray(deletedItem)) { + for (const item of deletedItem) { + const columnName = item.fields_name; + if (this.selectedValues[columnName]) { + const value = item.value; + const indexInArray = this.selectedValues[columnName].indexOf(value); + if (indexInArray !== -1) { + this.selectedValues[columnName].splice(indexInArray, 1); + } + } + } + } else if (typeof deletedItem === 'object') { + const columnName = deletedItem.fields_name; + if (this.selectedValues[columnName]) { + const value = deletedItem.value; + const indexInArray = this.selectedValues[columnName].indexOf(value); + if (indexInArray !== -1) { + this.selectedValues[columnName].splice(indexInArray, 1); + } + } + } + } + + console.log(this.selectedValues); + this.filterRowsBySelectedValues(); + } + + + rows:any[]; + filterRows:any[]; + columns: any[]; + rowdata; + FromDatequery; + ToDatequery; + + newfrom; + newto; + + dateKey; +runtheQuery(){ + console.log(this.myDateValue , this.toDate); + let query = this.SQLQuery; +// let query + if(this.dynamicForm.value){ + // for(let i = 0; i < this.dynamicForm.value.length; i++){ + // // const query = this.SQLQuery + " AND " + this.dynamicForm.controls[i] + " = " + this.dynamicForm.value[i] + + // } + + + // Iterate over the keys in dynamicForm.value + Object.keys(this.dynamicForm.value).forEach((key) => { + // Append the condition for each key to the query + if (this.dynamicForm.value[key] !== null ) { + this.selectcolumn(this.dynamicForm.value); + // query += ` AND ${key} = '${this.dynamicForm.value[key]}'`; + } + // const regex = /FROM/i; + // const match = query.match(regex); + // if (this.dynamicForm.value[key] !== null && this.dynamicForm.value[key] !== '') { + // // query += ` AND ${key} = '${this.dynamicForm.value[key]}'`; + // const columnName = key.split('.').pop(); + // let coalesceExpression = `, COALESCE(${key}, '${this.dynamicForm.value[key]}') as ${columnName}`; + // if (match) { + // // Insert the COALESCE expression before the FROM keyword + // query = query.slice(0, match.index) + coalesceExpression +' '+ query.slice(match.index); + // } + // } + }); + // if(this.FromDatequery && this.ToDatequery){ + // query += ` AND cretaedat BETWEEN '${this.FromDatequery}' AND '${this.ToDatequery}'`; + + // }else + if(this.DateParam == true){ + this.dateKey = 'createdat'; + this.adhocList.forEach(key => { + if (key.includes("created_at")) { + this.dateKey ="created_at" ; + } + }); + this.adhocList.forEach(key => { + if (key.includes("createdAt")) { + this.dateKey ="createdAt" ; + } +}); + if(this.myDateValue && this.toDate){ + if(this.myDateValue){ + this.newfrom = new Date(this.myDateValue); + // const year = inputDate.getFullYear(); + // const month = String(inputDate.getMonth() + 1).padStart(2, "0"); // Months are zero-based, so add 1 + // const day = String(inputDate.getDate()).padStart(2, "0"); + // this.newfrom = `${year}-${month}-${day}`; + } + if(this.toDate){ + this.newto = new Date(this.toDate); + // const year = inputDate.getFullYear(); + // const month = String(inputDate.getMonth() + 1).padStart(2, "0"); // Months are zero-based, so add 1 + // const day = String(inputDate.getDate()).padStart(2, "0"); + // this.newto = `${year}-${month}-${day}`; + + } + query += ` AND ${this.dateKey} BETWEEN '${this.newfrom}' AND '${this.newto}'`; + +} + } + // if(this.myDateValue && this.toDate){ + // query += ` AND from_date = NVL(${this.myDateValue}from_date, 'from_date') AND to_date = NVL(${this.toDate}to_date, 'to_date')`; + // } + console.log(query); + } +// if(this.FormattedAdhocparameters){ +// query += this.FormattedAdhocparameters +// } + + this.selectcolumn(this.serverData); +// query = `SELECT a.name AS name, b.dob AS dob FROM abc a, abcde b WHERE a.name = 'gaurav' AND a.abc = NVL(b.abc, 'name') AND a.abcde = NVL(b.abcde, 'test');` + console.log(query); + this.reportBuilderService.getMasterData(query).subscribe((data) => { + // this.rows = data; + + console.log(this.rows); +this.rowdata= [this.rows]; + console.log(typeof this.rows); + if(data){ + this.toastr.success("Run Successfully") + } + var j; + var cart = []; + + for(var i = 0; i < data.length; i++) + { + var columnsIn = data[i]; + if(i==1) + { + for(var key in columnsIn) + { + j={prop:key , name: key}; + cart.push(j) + + } + } + } + this.columns = cart; + +}); +} +getHeaders() { +let headers: string[] = []; +if(this.rows) { + this.rows.forEach((value) => { + Object.keys(value).forEach((key) => { + if(!headers.find((header) => header == key)){ + headers.push(key) + } + + }) + + }) +} +return headers; +} + +getFilterHeaders() { + let headers: string[] = []; + if(this.filterRows) { + this.filterRows.forEach((value) => { + Object.keys(value).forEach((key) => { + if(!headers.find((header) => header == key)){ + headers.push(key) + } + }) + }) + } + return headers; + } + + + +selectedValues: { [key: string]: any[] } = {}; +selectcolumn(data: any) { + if (Array.isArray(data)) { + for (const item of data) { + const columnName = item.fields_name; + const value = item.value; + + // Check if fields_name is not empty and value is not null or empty string + if (columnName.trim() !== '') { + if (!this.selectedValues[columnName]) { + this.selectedValues[columnName] = []; + } + + if (value !== null && value.trim() !== '') { + // Only add the value if it's not null and not an empty string + if (!this.selectedValues[columnName].includes(value)) { + this.selectedValues[columnName].push(value); + } + } else { + // Remove the property if the value is null or empty string + delete this.selectedValues[columnName]; + } + } + } + } else if (typeof data === 'object') { + // Handle the first JSON structure (object) + console.log(data); + for (const key in data) { + if (data.hasOwnProperty(key)) { + const columnName = key; + const value = data[key]; + + if (!this.selectedValues[columnName]) { + this.selectedValues[columnName] = []; + } + + if (value !== null && value.trim() !== '') { + // Only add the value if it's not null and not an empty string + if (!this.selectedValues[columnName].includes(value)) { + this.selectedValues[columnName].push(value); + } + } else { + // Remove the property if the value is null or empty string + delete this.selectedValues[columnName]; + } + } + } + } + + console.log(this.selectedValues); + this.filterRowsBySelectedValues(); +} + + + + +filtered = false; +filterRowsBySelectedValues() { + // Create a filteredRows array to store the filtered data + const filteredRows = []; + + // Iterate through each row in the rows array + for (const row of this.rows) { + let isMatch = true; + + // Iterate through each column in the selectedValues object + for (const columnName in this.selectedValues) { + if (this.selectedValues.hasOwnProperty(columnName) && row.hasOwnProperty(columnName)) { + // Get the selected values for the current column + const selectedValuesForColumn = this.selectedValues[columnName]; + + // Get the type of the row's value for the current column + const rowValue = row[columnName]; + const rowValueType = typeof rowValue; + + if (rowValueType === 'boolean') { + // Handle boolean values + if (selectedValuesForColumn.length === 0) { + // If no specific value selected for boolean, include the row + continue; + } + + const selectedBooleanValue = selectedValuesForColumn[0] === 'true'; // Convert to boolean + if (selectedBooleanValue !== rowValue) { + isMatch = false; + break; // No need to check other columns if it's not a match + } + } else { + // Handle other data types, including numbers and strings + // Convert selected values to the appropriate type + const convertedValues = selectedValuesForColumn.map((value) => { + if (rowValueType === 'number') { + return parseFloat(value); // Convert to number + } else { + return value; // Keep the original value (string, etc.) + } + }); + + // Check if the row's value for the current column matches any selected value + if (!convertedValues.includes(rowValue)) { + isMatch = false; + break; // No need to check other columns if it's not a match + } + } + } + } + if(this.FromDatequery !== null && this.ToDatequery !== null){ + this.newfrom = this.FromDatequery + this.newto = this.ToDatequery + } + + if (this.newfrom !== null && this.newto !== null) { + // Extract the year, month, and day from newfrom and newto + const from = new Date(this.newfrom); + const to = new Date(this.newto); + const newfromYear = from.getFullYear(); + const newfromMonth = from.getMonth(); + const newfromDay = from.getDate(); + const newtoYear = to.getFullYear(); + const newtoMonth = to.getMonth(); + const newtoDay = to.getDate(); + + // Extract the year, month, and day from createdAtDate + const dateKey = this.dateKey; + const createdAtDate = new Date(row[dateKey]); + const createdAtYear = createdAtDate.getFullYear(); + const createdAtMonth = createdAtDate.getMonth(); + const createdAtDay = createdAtDate.getDate(); + + // Create new Date objects using the extracted year, month, and day + const newfromDate = new Date(newfromYear, newfromMonth, newfromDay); + const newtoDate = new Date(newtoYear, newtoMonth, newtoDay); + const createdAtDateOnly = new Date(createdAtYear, createdAtMonth, createdAtDay); + + // Check if the createdAtDateOnly is within the specified date range + if (createdAtDateOnly < newfromDate || createdAtDateOnly > newtoDate) { + isMatch = false; + } + } + + + // If the row matches all selected values, add it to the filteredRows array + if (isMatch) { + filteredRows.push(row); + } + } + + // Assign the filtered data to the rows + console.log(filteredRows); + this.filterRows = filteredRows; + + // Check if all arrays in selectedValues are empty + const allArraysEmpty = Object.values(this.selectedValues).every(arr => arr.length === 0); + + // Check if the date range is not selected + const dateRangeNotSelected = !this.newfrom || !this.newto; + + // Set this.filtered based on allArraysEmpty and dateRangeNotSelected + this.filtered = !allArraysEmpty || !dateRangeNotSelected; +} + + + +formatDate(dateObj: any): string { + // Extract individual date properties + const { year, monthValue, dayOfMonth, hour, minute, second } = dateObj; + + // Create a JavaScript Date object using the extracted properties + const formattedDate = new Date(year, monthValue - 1, dayOfMonth, hour, minute, second); + + // Format the date as needed (e.g., using built-in JavaScript date formatting) + return formattedDate.toLocaleString(); // Or any other desired formatting +} + +isDate(value: any): boolean { + return ( + value instanceof Date || + (value && + value.year !== undefined && + value.monthValue !== undefined && + value.dayOfMonth !== undefined) + ); +} + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.html new file mode 100644 index 0000000..972d75d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.html @@ -0,0 +1,148 @@ + + +
+ +
+
+
+ +
+
+ + +
+

{{ 'SETUP_TOOLS' | translate }}

+
+ +
+ +
+
+ + +
+
+
+ +
+
+ +
+

+
+
+ {{item.menuItemDesc}} +
+
+ +
+
+
+ {{item.menuItemDesc}} +
+
+
+
+
+
+ + +
+
+ +
+
+
+ +
+

+
+
+ {{ 'REPORTS' | translate }} +
+
+ +
+
+
+ {{ 'REPORTS_DESCRIPTION' | translate }} +
+
+
+
+
+
+ + + + +
+
+ +
+
+
+ +
+

+
+
+ {{ 'API_REGISTERY' | translate + }} +
+
+ +
+
+
+ {{ 'API_REGISTERY_DESCRIPTION' | translate }} +
+
+
+
+
+
+ + + + +
+
+ +
+
+
+ +
+

+
+
+ {{ 'TOKEN_REGISTERY' | + translate + }} +
+
+ +
+
+
+ {{ 'TOKEN_REGISTERY_DESCRIPTION' | translate + }} +
+
+
+
+
+
+ + + +
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.scss new file mode 100644 index 0000000..126a257 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.scss @@ -0,0 +1,47 @@ +// .card-body{ +// justify-content: center; +// margin: 50px auto 50px 80px; +// padding: 10px; +// } + +.card { + position: relative; + display: block; + background-color: #fff; + background-color: var(--clr-card-bg-color, white); + width: 100%; + // margin-top: 1.2rem; + height: 135px; + + margin: 10px; + +} + +.clr-col-sm-2{ + margin:20px 40px 20px 40px; +} + + +input[type='radio']{ + width: 14px !important; + height: 14px !important; + margin: 5px; + -webkit-appearance: none; + -moz-appearance: none; + -o-appearance: none; + appearance: none; + outline: 1px solid gray; + box-shadow: none; + font-size: 0.8em; + text-align: center; + line-height: 1em; + background: red; + } + .dots + { + width: 100px; + height:100px; + border: 1px solid; + border-radius: 50%; + //background-color: #f00; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.spec.ts new file mode 100644 index 0000000..2a94930 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SetupiconComponent } from './setupicon.component'; + +describe('SetupiconComponent', () => { + let component: SetupiconComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [SetupiconComponent] + }); + fixture = TestBed.createComponent(SetupiconComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.ts new file mode 100644 index 0000000..4e62715 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/setupicon/setupicon.component.ts @@ -0,0 +1,97 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MenuGroupService } from 'src/app/services/admin/menu-group.service'; +import { MenumaintanceService } from 'src/app/services/admin/menumaintance.service'; +import { TranslateService } from '@ngx-translate/core'; +@Component({ + selector: 'app-setupicon', + templateUrl: './setupicon.component.html', + styleUrls: ['./setupicon.component.scss'] +}) +export class SetupiconComponent implements OnInit { + + sub; + constructor(private router: Router, private route: ActivatedRoute, private menuservice: MenumaintanceService, private menuGroupService: MenuGroupService, + private translate: TranslateService + ) { } + + + ngOnInit(): void { + this.getById(1116) + } + switchLanguage(language: string) { + this.translate.use(language); + } + getById(id: any) { + this.menuservice.getbyid(id).subscribe((data) => { + this.sub = data; + console.log(this.sub) + }) + } + mc; + me; + md; + mv; + goToUserMaintenance(val) { + console.log(val); + this.menuGroupService.storeaddeditvalues(val); + this.mc = val.mcreate; + this.me = val.medit; + this.md = val.mdelete; + this.mv = val.mvisible; + if (this.mv == 'false') { + this.router.navigate(['/**']) + } + this.router.navigate(['../' + val.main_menu_action_name], { relativeTo: this.route }); + } + + goToUsergrpMaintenance() { + this.router.navigate(['/cns-portal/usergrpmaintance'], { relativeTo: this.route }); + } + + goToMenumaintance() { + this.router.navigate(['/cns-portal/menumaintance'], { relativeTo: this.route }); + } + + goToMenuaccess() { + this.router.navigate(['/cns-portal/menuaccess'], { relativeTo: this.route }); + } + + goToSystemparameters() { + this.router.navigate(['/cns-portal/systemparameters'], { relativeTo: this.route }); + } + + goToAccesstype() { + this.router.navigate(['/cns-portal/accesstype'], { relativeTo: this.route }); + } + + goToreport() { + this.router.navigate(['/cns-portal/reportbuild'], { relativeTo: this.route }); + } + + goTodash() { + this.router.navigate(['/cns-portal/dashboardbuilder'], { relativeTo: this.route }); + } + + goToApiRegistery() { + this.router.navigate(['/cns-portal/apiregistery'], { relativeTo: this.route }); + } + + goTokenRegistery() { + this.router.navigate(['/cns-portal/tokenregistery'], { relativeTo: this.route }); + } + + + // mc; + // me; + // md; + // mv; + // send(val){ + // console.log(val); + // this.menuGroupService.storeaddeditvalues(val); + // this.mc=val.mcreate; + // this.me=val.medit; + // this.md=val.mdelete; + // this.mv=val.mvisible; + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.spec.ts new file mode 100644 index 0000000..7981adb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BulkimportComponent } from './bulkimport.component'; + +describe('BulkimportComponent', () => { + let component: BulkimportComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BulkimportComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BulkimportComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.ts new file mode 100644 index 0000000..d00d0dc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimport.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-bulkimport', + templateUrl: './bulkimport.component.html', + styleUrls: ['./bulkimport.component.scss'] +}) +export class BulkimportComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.html new file mode 100644 index 0000000..e2ad5c2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.html @@ -0,0 +1,183 @@ +

Validation Rule

+Add Mode
+Validation Rules are proccessed while importing bulk records for respective entity +
+ + + + + + + + +
+ + + + + +
+
+
+ + +
+
+ + +
+ +
+ + + +
+
+ + +
+
Add Rule
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rule NameFrom SheetFrom Columnvalidation TableCheck ColumnReplacement Column (Id)Use Column (Id)Error MessageAction
+ + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+
+ + +
+
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.scss new file mode 100644 index 0000000..b05187f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.scss @@ -0,0 +1,81 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + margin-top: 3px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.spec.ts new file mode 100644 index 0000000..187619d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BulkimportaddComponent } from './bulkimportadd.component'; + +describe('BulkimportaddComponent', () => { + let component: BulkimportaddComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BulkimportaddComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BulkimportaddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.ts new file mode 100644 index 0000000..6e52222 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportadd/bulkimportadd.component.ts @@ -0,0 +1,236 @@ +import { HttpErrorResponse, HttpHeaderResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { BulkimportService } from 'src/app/services/fnd/bulkimport.service'; +@Component({ + selector: 'app-bulkimportadd', + templateUrl: './bulkimportadd.component.html', + styleUrls: ['./bulkimportadd.component.scss'] +}) +export class BulkimportaddComponent implements OnInit { + public entryForm: FormGroup; + selectedFile: File[]=[]; + + datajson; + transform:boolean = false; + checkTransform:boolean = true; + mapperdata; + + entityname; + description; + constructor(private _fb: FormBuilder, private router: Router,private toastr: ToastrService, + private route: ActivatedRoute,private dataservice:BulkimportService) { } + + ngOnInit(): void { + this.entryForm = this._fb.group({ + entity_name:[null], + rule_line:[null], + description: [null], + active: [true], + }); + + this.route.queryParams.subscribe(params => { + const data = params['data']; + this.entityname = params['name']; + this.description = params['description']; + + + if (data) { + try { + this.datajson = JSON.parse(data); + console.log('Received data:', this.datajson); + } catch (e) { console.error('Invalid JSON:', data);} + } + + + }); + + const condition = this.dataservice.getCondition(); + if(condition === 'mapper'){ + this.transform = true; + this.checkTransform = false; + if(this.datajson!== undefined){ + // if(this.entryForm.value.rule_line == 'undefined'){ this.entryForm.value.rule_line= '';} + const currentText = this.entryForm.value.rule_line = ''; + this.mapperdata = currentText + this.datajson; + // this.entryForm.value.rule_line = this.mapperdata; + // this.Updating(); + this.dataservice.setCondition(''); + } + } + + + console.log(this.entryForm.value); + + this.entryForm.patchValue({ + entity_name: this.entityname, + description: this.description, + }); + + console.log(this.entryForm.value); + } + + serverData = [ + { + "rulename": "", + "fromsheet": "", + "fromColumn": "", + "validationTable": "", + "checkColumn": "", + "replacementcolumn": "", + "useColumn": "", + "errormsg": "" + }]; + onAddLines(){ + this.serverData.push({ + rulename: "", + fromsheet:"", + fromColumn: "", + validationTable: "", + checkColumn: "", + replacementcolumn:"", + useColumn:"", + errormsg:"" + }); + console.log(this.serverData); + } + deleteRow(index) { + this.serverData.splice(index, 1); + } + + toastrShown: boolean = false; + onSubmit(){ + this.entryForm.value.rule_line = JSON.stringify(this.serverData); + console.log(this.entryForm.value); + this.dataservice.saveData(this.entryForm.value).subscribe((data)=>{ + console.log(data); + if (data) { + if (!this.toastrShown) { + this.toastrShown = true; // Set the flag to indicate that the toastr message has been shown + this.toastr.success("Added Successfully"); + setTimeout(() => { + this.router.navigate(["../all"], { relativeTo: this.route }); + }, 500); + } + } + }, (error: HttpHeaderResponse)=>{ + console.log(error); + if(error.status===202){ + this.toastr.success("Added Succesfully"); + } + if(error.status===404){ + this.toastr.error("Not Added"); + } + if(error.status===400){ + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.router.navigate(["../all"], { relativeTo: this.route }); + },500); + } + goback(){ + this.router.navigate(["../all"], { relativeTo: this.route }); + } + + + ///rules + checkTrans(){ + + console.log("rule line open") + this.dataservice.setCondition('mapper'); + + this.router.navigate(["../ruleline/"], { relativeTo: this.route, queryParams: {data:this.entryForm.value.rule_line, entityname:this.entryForm.value.entity_name, description:this.entryForm.value.description}, skipLocationChange: true}); + console.log(this.entryForm.value.entity_name); + + } + + mappperclick = false; + goFromMapper(){ + //this.mappperclick = true; + this.dataservice.setCondition('mapper'); + this.router.navigate(["../ruleline/"], { relativeTo: this.route, queryParams: {data:this.entryForm.value.rule_line, entityname:this.entryForm.value.entity_name, description:this.entryForm.value.description}, skipLocationChange: true}); + console.log(this.entryForm.value.entity_name); + } + + transReset(){ + this.entryForm.value.rule_line = undefined; + this.transform = false; + this.checkTransform = true; + } + + + headerData; + getColumns(table){ + console.log(table); + // console.log(this.getbyiddata.entityName); + this.dataservice.getColumnNames(table).subscribe((data) => { + console.log(data); + this.headerData = data; + }); +} + + checkTransformMapper = true; + transformMapper = false; + mapperText; + getHeaderData; + JsonHeader = []; + selectedSheetName: string | null = null; + columnJson =[]; + sheetNames:any; + checkTransMapper(){ + + console.log("Mapper open") + // console.log(this.storeData); + if(this.getHeaderData){ + this.checkTransformMapper = false; + this.transformMapper = true; + console.log(this.getHeaderData); + if(this.mapperText === "undefined"){ this.mapperText= '';} + const currentText = this.mapperText; + let trnsfData = currentText + '' +this.getHeaderData; + this.mapperText = trnsfData; + }else { + this.checkTransformMapper = true; + this.transformMapper = false; + } + + } + mappperModal = false; + goFromMapperField(){ + this.mappperModal = true; + this.selectedSheetName = this.sheetNames[0]; + const tablename = this.columnJson[0].TableName; + this.getColumns(tablename) + if(this.mapperText){ + try { + this.JsonHeader = JSON.parse(this.mapperText); + console.log('Received data:', this.JsonHeader ); + } catch (e) { console.error('Invalid JSON:', this.mapperText);} + }else + if (this.getHeaderData) { + // try { + // this.serverData = data.replace(/\[|\]|"/g, '').split(','); //(/\[|\]|'/g, '') //(/[\[\]"]/g, '') + // console.log('Received data:', this.serverData ); + // } catch (e) { console.error('Invalid JSON:', data);} + try { + this.JsonHeader = JSON.parse(this.getHeaderData); + console.log('Received data:', this.JsonHeader ); + } catch (e) { console.error('Invalid JSON:', this.getHeaderData);} + + } + } + + transResetMapper(){ + this.mapperText = ''; + this.transformMapper = false; + this.checkTransformMapper = true; + } + + onUpdate(){ + this.mappperModal = false; + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.html new file mode 100644 index 0000000..7a33825 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.html @@ -0,0 +1,81 @@ + + +
+ +
+
+
+

Validation Rule

+
+
+ + + +
+
+ + + Loading ... +
{{error}}
+ + + Entity Name + + + Description + + + Active + + + Action + + + {{user.entity_name}} + {{user.description}} + {{user.active}} + + + + Delete + + + + + + + + + + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.scss new file mode 100644 index 0000000..c05b1dc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.scss @@ -0,0 +1,4 @@ +.delete,.heading{ + text-align: center; + color: red; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.spec.ts new file mode 100644 index 0000000..4627941 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BulkimportallComponent } from './bulkimportall.component'; + +describe('BulkimportallComponent', () => { + let component: BulkimportallComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BulkimportallComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BulkimportallComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.ts new file mode 100644 index 0000000..008c056 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportall/bulkimportall.component.ts @@ -0,0 +1,87 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { ExcelService } from 'src/app/services/excel.service'; +import * as moment from 'moment'; +import { BulkimportService } from 'src/app/services/fnd/bulkimport.service'; + +@Component({ + selector: 'app-bulkimportall', + templateUrl: './bulkimportall.component.html', + styleUrls: ['./bulkimportall.component.scss'] +}) +export class BulkimportallComponent implements OnInit { + + loading = false; + error; + selected: any[] = []; + rowSelected :any= {}; + modaldelete=false; + data; + constructor(private router: Router, private toastr: ToastrService, + private route: ActivatedRoute,private excel: ExcelService,private bulkimportService:BulkimportService,) { } + + ngOnInit(): void { + this.getall(); + } + getall(){ + this.bulkimportService.getDetails().subscribe((data)=>{ + console.log(data); + this.data=data; + if(this.data.length == 0){ + this.error="No data Available"; + console.log(this.error); + } + + },(error) => { + console.log(error); + if(error){ + this.error="No data Available OR server Error"; + } + }); + + } + goToAdd(){ + this.router.navigate(["../add"], { relativeTo: this.route }); + + } + onExport() { + this.excel.exportAsExcelFile(this.data, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + goToEdit(id) { + this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + + delete(id){ + this.modaldelete = false; + console.log("in delete "+id); + this.bulkimportService.deleteById(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data == null || data) { + this.toastr.success('Deleted successfully'); + } + }, + (error) => { + console.log('Error in adding data...',+error); + if(isNaN(error)){ + this.toastr.success('Deleted successfully'); + }else{ + this.toastr.error('Not Deleted Data Getting Some Error'); + } + } + ); +} + +activeTab: number = 1; + +showTab(tabNumber: number) { + this.activeTab = tabNumber; +} +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.html new file mode 100644 index 0000000..ed86b6a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.html @@ -0,0 +1,116 @@ +

Validation Rule

+Edit Mode
+Validation Rules are proccessed while importing bulk records for respective entity +
+
+
+
+
+ + +
+
+ + +
+ +
+ + + +
+
+ + +
+
Select open to add rules, select reset to delete existing rules
+
+
+
+
Add Rule
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rule NameFrom SheetFrom Columnvalidation TableCheck ColumnReplacement Column (Id)Use Column (Id)Error MessageAction
+ + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+
+ + +
+
+ +
+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.scss new file mode 100644 index 0000000..b05187f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.scss @@ -0,0 +1,81 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + margin-top: 3px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.spec.ts new file mode 100644 index 0000000..766987b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BulkimporteditComponent } from './bulkimportedit.component'; + +describe('BulkimporteditComponent', () => { + let component: BulkimporteditComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BulkimporteditComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BulkimporteditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.ts new file mode 100644 index 0000000..34cdd86 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportedit/bulkimportedit.component.ts @@ -0,0 +1,200 @@ +import { HttpErrorResponse, HttpHeaderResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { BulkimportService } from 'src/app/services/fnd/bulkimport.service'; + +@Component({ + selector: 'app-bulkimportedit', + templateUrl: './bulkimportedit.component.html', + styleUrls: ['./bulkimportedit.component.scss'] +}) +export class BulkimporteditComponent implements OnInit { + public entryForm: FormGroup; + selectedFile: File[]=[]; + id; + datajson; + transform:boolean = false; + checkTransform:boolean = true; + mapperdata; + tdata: any = {}; + entityname; + description; + constructor(private _fb: FormBuilder, private router: Router,private toastr: ToastrService, + private route: ActivatedRoute,private dataservice:BulkimportService) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + + // this.entryForm = this._fb.group({ + // entity_name:[null], + // rule_line:[null], + // description: [null], + // active: [true], + // }); + + + this.dataservice.getDetailsById(this.id).subscribe(data => { + this.tdata = data; + this.serverData = JSON.parse(data.rule_line); + console.log(this.tdata); + }, + (err) => { + console.log(err); + }); + + + setTimeout(() => { + + + this.route.queryParams.subscribe(params => { + const data = params['data']; + this.entityname = params['name']; + this.description = params['description']; + + + if (data) { + try { + this.datajson = JSON.parse(data); + console.log('Received data:', this.datajson); + } catch (e) { console.error('Invalid JSON:', data);} + } + + + }); + + if(this.tdata.rule_line !== '' && this.tdata.rule_line !== null && this.tdata.rule_line !== undefined) { + console.log(this.tdata.rule_line) + this.checkTransform = false; + this.transform = true; + }else{ + console.log(this.tdata.rule_line) + this.checkTransform = true; + this.transform = false; + this.checkTransform = true; + } + + const condition = this.dataservice.getCondition(); + if(condition === 'mapper'){ + console.log("datagetting"); + this.transform = true; + this.checkTransform = false; + if(this.datajson!== undefined){ + // if(this.entryForm.value.rule_line == 'undefined'){ this.entryForm.value.rule_line= '';} + const currentText = this.tdata.rule_line = ''; + this.mapperdata = currentText + this.datajson; + this.tdata.rule_line = this.mapperdata; + // this.Updating(); + this.dataservice.setCondition(''); + } + } +}, 1000); + + console.log(this.tdata); + // this.entryForm.patchValue({ + // entity_name: this.entityname, + // description: this.description, + // }); + // console.log(this.entryForm.value); + } + + getById(id: number) { + + } + + serverData = []; + onAddLines(){ + this.serverData.push({ + rulename: "", + fromsheet:"", + fromColumn: "", + validationTable: "", + checkColumn: "", + replacementcolumn:"", + useColumn:"", + errormsg:"" + }); + console.log(this.serverData); + } + deleteRow(index) { + this.serverData.splice(index, 1); + } + + toastrShown: boolean = false; + onSubmit(){ + this.tdata.rule_line = JSON.stringify(this.serverData); + console.log(this.tdata); + this.dataservice.updateData(this.tdata, this.id).subscribe((data)=>{ + console.log(data); + if (data.operationStatus) { + this.toastr.warning(data.operationMessage); + }else{ + if (!this.toastrShown) { + this.toastrShown = true; // Set the flag to indicate that the toastr message has been shown + this.toastr.success("Update Successfully"); + setTimeout(() => { + this.router.navigate(["../../all"], { relativeTo: this.route }); + }, 500); + } + } + }, (error: HttpHeaderResponse)=>{ + console.log(error); + if(error.status===202){ + this.toastr.success("Update Succesfully"); + } + if(error.status===404){ + this.toastr.error("Not Update"); + } + if(error.status===400){ + this.toastr.error("Not Update"); + } + }); + setTimeout(() => { + this.router.navigate(["../../all"], { relativeTo: this.route }); + },500); + } + + Updating(){ + console.log(this.tdata); + this.dataservice.updateData(this.tdata, this.id).subscribe(data=>{ + console.log(data); + // this.ngOnInit(); + }, (error: HttpHeaderResponse)=>{ + console.log(error); + }); + } + + goback(){ + this.router.navigate(["../../all"], { relativeTo: this.route }); + } + + + + ///rules + checkTrans(){ + + console.log("rule line open") + this.dataservice.setCondition('mapper'); + + this.router.navigate(["../../rulelineedit/"], { relativeTo: this.route, queryParams: {id:this.id, data:this.tdata.rule_line, entityname:this.tdata.entity_name, description:this.tdata.description}, skipLocationChange: true}); + console.log(this.tdata.rule_line); + + } + + mappperclick = false; + goFromMapper(){ + //this.mappperclick = true; + this.dataservice.setCondition('mapper'); + this.router.navigate(["../../rulelineedit/"], { relativeTo: this.route, queryParams: {id:this.id, data:this.tdata.rule_line, entityname:this.tdata.entity_name, description:this.tdata.description}, skipLocationChange: true}); + console.log(this.tdata.rule_line); + } + + transReset(){ + this.tdata.rule_line = undefined; + this.transform = false; + this.checkTransform = true; + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.html new file mode 100644 index 0000000..5efccb0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.html @@ -0,0 +1,73 @@ +

Add Rule Lines

+
+
+
+ +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rule NameFrom SheetFrom Columnvalidation TableCheck ColumnReplacement Column (Id)Use Column (Id)Error MessageAction
+ + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ + +
+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.scss new file mode 100644 index 0000000..c1113c0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.scss @@ -0,0 +1,51 @@ +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.35rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + input[type=text],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + .required-field{ + color: red; + + } + .postColumn{ + border: 1px solid #ccc; + width: 78%; + margin-left: 15px; + } + .colName{ + text-align: center; + padding: 5px; + } + .colfields{ + border: 1px solid black; + margin: 17px; + text-align: center; + padding: 3px; + } + .fieldWrapper{ + margin-top: 20px; + } + .center { + text-align: center; + } + + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.spec.ts new file mode 100644 index 0000000..cd66c14 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BulkimporteditlineComponent } from './bulkimporteditline.component'; + +describe('BulkimporteditlineComponent', () => { + let component: BulkimporteditlineComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BulkimporteditlineComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BulkimporteditlineComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.ts new file mode 100644 index 0000000..bfee4cf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component.ts @@ -0,0 +1,172 @@ +import { Component, OnInit } from '@angular/core'; +import { FormGroup, FormBuilder, FormArray } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { DataflowService } from 'src/app/services/fnd/dataflow.service'; +// import { NewwebhookService } from 'src/app/services/fnd/newwebhook.service'; +// import { SftplocationService } from 'src/app/services/fnd/sftplocation.service'; +// import { Webhookservicesui1Service } from 'src/app/services/fnd/webhookservicesui1.service'; + +@Component({ + selector: 'app-bulkimporteditline', + templateUrl: './bulkimporteditline.component.html', + styleUrls: ['./bulkimporteditline.component.scss'] +}) +export class BulkimporteditlineComponent implements OnInit { + serverData = []; + id; + title + sourceTable; + sourceFData; + Mid:any; + flowType; + remoteD; + sftpDId; + emailDId; + key; + webhookDId; + + name; + description; + // data = ['email', 'password'] + constructor( private router : Router, + private route: ActivatedRoute, + private dataservice:DataflowService, + // private sftpService:SftplocationService, + // private emaildbService:Webhookservicesui1Service, + // private webhookService:NewwebhookService, + private _fb:FormBuilder) { } + + public entryForm: FormGroup; + + ngOnInit(): void { + // this.entryForm = this._fb.group({ + // connector_json: this._fb.array([]) + // }); + + this.route.queryParams.subscribe(params => { + this.id = params['id']; + // this.Mid = params['mid']; + const data = params['data']; + this.name = params['entityname']; + this.description = params['description']; + if (data) { + // try { + // this.serverData = data.replace(/\[|\]|"/g, '').split(','); //(/\[|\]|'/g, '') //(/[\[\]"]/g, '') + // console.log('Received data:', this.serverData ); + // } catch (e) { console.error('Invalid JSON:', data);} + try { + this.serverData = JSON.parse(data); + console.log('Received data:', this.serverData ); + } catch (e) { console.error('Invalid JSON:', data);} + } + // this.serverData.map(d => + // this.person.push(this._fb.group({ andor: '', fields_name:'',condition:'',value: d ,})) + // ); + + }); + + const condition = this.dataservice.getCondition(); + if(condition === 'mapper'){ + console.log("mapper") + }else if(condition === 'filter'){ + console.log("filter"); + } + console.log(this.name,this.description); + + + + + } + + columnList(){ + + this.dataservice.getColumnListFromSourceTable(this.id,this.title).subscribe((data)=>{ + console.log(data); + this.sourceTable = data; + }); + } + + // sftpHeader(){ + // this.sftpService.getExcelHeaders(this.title,this.remoteD).subscribe((headers) => { + // console.log("sftp Data",headers); + // this.sourceTable = headers; + // }); + // } + + // emailHeader(){ + // this.emaildbService.getHeadersFromExcelMail(this.emailDId,this.title,this.key).subscribe((headers)=>{ + // console.log("email Data",headers); + // this.sourceTable = headers; + // }); + // } + + // webhookHeader(){ + // this.webhookService.getHeadersFromWBExcelMail(this.webhookDId,this.title,this.key).subscribe((headers)=>{ + // console.log("webhook Data",headers); + // this.sourceTable = headers; + // }); + // } + + + FilDemo(){ + let data = [""]; + const defaultObject = { + andor: "AND", + fields_name: "", + condition: "=", +} + const objectArray = data.map(value => ({ + ...defaultObject, + value: value, + })); + console.log(objectArray); + this.sourceFData = JSON.stringify(objectArray); + + try { + this.serverData = JSON.parse(this.sourceFData); + console.log('Received data:', this.serverData ); + } catch (e) { console.error('Invalid JSON:', this.sourceFData);} + + + + } + // get person() { + // return this.entryForm.get("connector_json") as FormArray; + // } + + onUpdate(){ + console.log(this.serverData); + let serverData = JSON.stringify(this.serverData); + console.log(serverData); + let product = JSON.stringify(serverData); + console.log(product); + console.log(this.Mid); + this.router.navigate(['../edit/'+ this.id],{relativeTo:this.route, queryParams: { data: product, name:this.name, description:this.description }, skipLocationChange: true}); + } + back(){ + this.router.navigate(['../edit/'+ this.id], { relativeTo: this.route }); + this.dataservice.setCondition(''); + } + + onAddLines(){ + this.serverData.push({ + rulename: "", + fromsheet:"", + fromColumn: "", + validationTable: "", + checkColumn: "", + replacementcolumn:"", + useColumn:"", + errormsg:"" + }); + } + deleteRow(index) { + this.serverData.splice(index, 1); + } + + // postApi(){ + // this.data.map(d => + // this.person.push(this._fb.group({ fieldname: d , checkboxval:'',sample_format:'',mapped_fields:'',dest_format:''})) + // ); + // } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.html new file mode 100644 index 0000000..5efccb0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.html @@ -0,0 +1,73 @@ +

Add Rule Lines

+
+
+
+ +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rule NameFrom SheetFrom Columnvalidation TableCheck ColumnReplacement Column (Id)Use Column (Id)Error MessageAction
+ + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ + +
+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.scss new file mode 100644 index 0000000..c1113c0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.scss @@ -0,0 +1,51 @@ +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.35rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + input[type=text],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + .required-field{ + color: red; + + } + .postColumn{ + border: 1px solid #ccc; + width: 78%; + margin-left: 15px; + } + .colName{ + text-align: center; + padding: 5px; + } + .colfields{ + border: 1px solid black; + margin: 17px; + text-align: center; + padding: 3px; + } + .fieldWrapper{ + margin-top: 20px; + } + .center { + text-align: center; + } + + select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.spec.ts new file mode 100644 index 0000000..2e7b108 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BulkimportlineComponent } from './bulkimportline.component'; + +describe('BulkimportlineComponent', () => { + let component: BulkimportlineComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BulkimportlineComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BulkimportlineComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.ts new file mode 100644 index 0000000..0bc92f2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/bulkimport/bulkimportline/bulkimportline.component.ts @@ -0,0 +1,175 @@ +import { Component, OnInit } from '@angular/core'; +import { FormGroup, FormBuilder, FormArray } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { DataflowService } from 'src/app/services/fnd/dataflow.service'; +// import { NewwebhookService } from 'src/app/services/fnd/newwebhook.service'; +// import { SftplocationService } from 'src/app/services/fnd/sftplocation.service'; +// import { Webhookservicesui1Service } from 'src/app/services/fnd/webhookservicesui1.service'; + +@Component({ + selector: 'app-bulkimportline', + templateUrl: './bulkimportline.component.html', + styleUrls: ['./bulkimportline.component.scss'] +}) +export class BulkimportlineComponent implements OnInit { + serverData = []; + andor = ['AND', 'OR','NOT']; + fieldname = ['name1', 'name2']; + condition = ['=','!=','<','>','<=','>=','LIKE','BETWEEN','IN']; + id; + title + sourceTable; + sourceFData; + Mid:any; + flowType; + remoteD; + sftpDId; + emailDId; + key; + webhookDId; + + name; + description; + // data = ['email', 'password'] + constructor( private router : Router, + private route: ActivatedRoute, + private dataservice:DataflowService, + // private sftpService:SftplocationService, + // private emaildbService:Webhookservicesui1Service, + // private webhookService:NewwebhookService, + private _fb:FormBuilder) { } + + public entryForm: FormGroup; + + ngOnInit(): void { + // this.entryForm = this._fb.group({ + // connector_json: this._fb.array([]) + // }); + + this.route.queryParams.subscribe(params => { + // this.id = params['id']; + // this.Mid = params['mid']; + const data = params['data']; + this.name = params['entityname']; + this.description = params['description']; + if (data) { + // try { + // this.serverData = data.replace(/\[|\]|"/g, '').split(','); //(/\[|\]|'/g, '') //(/[\[\]"]/g, '') + // console.log('Received data:', this.serverData ); + // } catch (e) { console.error('Invalid JSON:', data);} + try { + this.serverData = JSON.parse(data); + console.log('Received data:', this.serverData ); + } catch (e) { console.error('Invalid JSON:', data);} + } + // this.serverData.map(d => + // this.person.push(this._fb.group({ andor: '', fields_name:'',condition:'',value: d ,})) + // ); + + }); + + const condition = this.dataservice.getCondition(); + if(condition === 'mapper'){ + console.log("mapper") + }else if(condition === 'filter'){ + console.log("filter"); + } + console.log(this.name,this.description); + + + + + } + + columnList(){ + + this.dataservice.getColumnListFromSourceTable(this.id,this.title).subscribe((data)=>{ + console.log(data); + this.sourceTable = data; + }); + } + + // sftpHeader(){ + // this.sftpService.getExcelHeaders(this.title,this.remoteD).subscribe((headers) => { + // console.log("sftp Data",headers); + // this.sourceTable = headers; + // }); + // } + + // emailHeader(){ + // this.emaildbService.getHeadersFromExcelMail(this.emailDId,this.title,this.key).subscribe((headers)=>{ + // console.log("email Data",headers); + // this.sourceTable = headers; + // }); + // } + + // webhookHeader(){ + // this.webhookService.getHeadersFromWBExcelMail(this.webhookDId,this.title,this.key).subscribe((headers)=>{ + // console.log("webhook Data",headers); + // this.sourceTable = headers; + // }); + // } + + + FilDemo(){ + let data = [""]; + const defaultObject = { + andor: "AND", + fields_name: "", + condition: "=", +} + const objectArray = data.map(value => ({ + ...defaultObject, + value: value, + })); + console.log(objectArray); + this.sourceFData = JSON.stringify(objectArray); + + try { + this.serverData = JSON.parse(this.sourceFData); + console.log('Received data:', this.serverData ); + } catch (e) { console.error('Invalid JSON:', this.sourceFData);} + + + + } + // get person() { + // return this.entryForm.get("connector_json") as FormArray; + // } + + onUpdate(){ + console.log(this.serverData); + let serverData = JSON.stringify(this.serverData); + console.log(serverData); + let product = JSON.stringify(serverData); + console.log(product); + console.log(this.Mid); + this.router.navigate(['../add'],{relativeTo:this.route, queryParams: { data: product, name:this.name, description:this.description }, skipLocationChange: true}); + } + back(){ + this.router.navigate(["../add"], { relativeTo: this.route }); + this.dataservice.setCondition(''); + } + + onAddLines(){ + this.serverData.push({ + rulename: "", + fromsheet:"", + fromColumn: "", + validationTable: "", + checkColumn: "", + replacementcolumn:"", + useColumn:"", + errormsg:"" + }); + } + deleteRow(index) { + this.serverData.splice(index, 1); + } + + // postApi(){ + // this.data.map(d => + // this.person.push(this._fb.group({ fieldname: d , checkboxval:'',sample_format:'',mapped_fields:'',dest_format:''})) + // ); + // } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.html new file mode 100644 index 0000000..b45ed70 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.html @@ -0,0 +1,176 @@ + + +
+
+
+

Data Management

+
+
+ + + + +
+
+ + Loading ... +
{{error}}
+
+ + + Go To + + + + + Entity Name + + + + File Name + + + Action + + + Workflow + {{user.entity_name}} + {{user.file_name}} + + + + Delete + + + + + + + + + + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.scss new file mode 100644 index 0000000..c6c7e70 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.scss @@ -0,0 +1,84 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} + +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +$bg-color: #dddddd; + +.section { + background-color: $bg-color; + height: 40px; +} + +.section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + margin-top: 3px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.required-field{ + color: red; + +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +.delete,.heading{ + text-align: center; + color: red; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.spec.ts new file mode 100644 index 0000000..19d47ed --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DatamanagementComponent } from './datamanagement.component'; + +describe('DatamanagementComponent', () => { + let component: DatamanagementComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DatamanagementComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DatamanagementComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.ts new file mode 100644 index 0000000..802a5e6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamanagement/datamanagement.component.ts @@ -0,0 +1,188 @@ +import { HttpErrorResponse, HttpHeaderResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import * as moment from 'moment'; +import { ToastrService } from 'ngx-toastr'; +import { DatamanagementService } from 'src/app/services/fnd/datamanagement.service'; +import { UsermaintanceService } from 'src/app/services/admin/usermaintance.service'; +import { ExcelService } from 'src/app/services/excel.service'; +import { BulkimportService } from 'src/app/services/fnd/bulkimport.service'; +@Component({ + selector: 'app-datamanagement', + templateUrl: './datamanagement.component.html', + styleUrls: ['./datamanagement.component.scss'] +}) +export class DatamanagementComponent implements OnInit { + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + selected: any[] = []; + error; + loading = false; + data; + udata; + selectedFile: File[] = []; + entitydata; + // tableList =['priority','impact','urgency','category','state','contact_type','customer','handler']; + tableList; + constructor(private excel: ExcelService, private datamservice: DatamanagementService, private toastr: ToastrService, + private _fb: FormBuilder, private userservice: UsermaintanceService, private router: Router, private bulkimportService: BulkimportService, + private route: ActivatedRoute,) { } + + ngOnInit(): void { + this.getall(); + // this.getuserall(); + this.allentity(); + this.entitygetall(); + this.entryForm = this._fb.group({ + user_id: [null], + file_name: [null], + entityName: [null], + // entity_name:[null], + file_type: [null], + + }); + // this.datamservice.getjson().subscribe((data)=>{ + // console.log(data); + // }) + } + getall() { + this.datamservice.getall().subscribe((data) => { + console.log('data managemnt ', data); + this.data = data; + if (this.data.length == 0) { + this.error = "No data Available"; + console.log(this.error); + } + + }, (error) => { + console.log(error); + if (error) { + this.error = "No data Available OR server Error"; + } + }); + } + + entitygetall() { + this.bulkimportService.getDetails().subscribe((data) => { + console.log(data); + this.tableList = data; + }, (error) => { + console.log(error); + }); + } + + + getuserall() { + this.userservice.getAll().subscribe((data) => { + console.log(data); + this.udata = data; + }) + } + allentity() { + // this.datamservice.getallentity().subscribe((data)=>{ + // console.log(data); + // this.entitydata=data; + // }, (error: HttpHeaderResponse)=>{ + // console.log(error); + // }) + } + onExport() { + this.excel.exportAsExcelFile(this.data, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + public onFileChanged(event) { + //Select File + console.log(event); + this.selectedFile = event.target.files[0]; + + } + goToAdd() { + this.modalAdd = true; + } + onSubmit() { + console.log(this.entryForm.value); + this.datamservice.create(this.selectedFile, this.entryForm.value.entityName).subscribe((data) => { + console.log(data); + if (data.status === 202) { + this.toastr.success("Added Succesfully"); + } + setTimeout(() => { + this.getall(); + }, 1000); + this.getall(); + }, (error: HttpErrorResponse) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + this.toastr.success("Added Succesfully"); + setTimeout(() => { + this.getall(); + }, 1000); + } + if (error.status === 404) { + this.toastr.error("Not Added"); + } + this.ngOnInit(); + }); + this.modalAdd = false; + } + onEdit(row) { + this.rowSelected = row; + this.modalEdit = true; + } + + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.datamservice.delete(id).subscribe( + (data) => { + console.log(data); + + this.ngOnInit(); + + if (data.status >= 200 && data.status <= 299 || data == null) { + this.toastr.success("Delete Succesfully"); + } + }, (error: HttpHeaderResponse) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + this.toastr.success("Delete Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Delete"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + } + }); + this.ngOnInit(); + } + onUpdate(id) { + this.modalEdit = false; + this.datamservice.update(id, this.rowSelected, this.selectedFile).subscribe( + (data) => { + console.log(data); + if (data.status === 202) { + this.toastr.success("Updated Succesfully"); + } + + }, + (error: HttpErrorResponse) => { + console.log(error.message); + } + ); + this.ngOnInit(); + } + work(id: any) { + console.log(id); + this.router.navigate(["../dataworkflow/" + id], { relativeTo: this.route }); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.html new file mode 100644 index 0000000..1268fb9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.html @@ -0,0 +1,497 @@ + + + + + + +
+ + + + + + + +
+ +
+
+
+
+
+
+

Data Import

+
+
+ +
+
+ +
+ + + + Step 0 + Review + + + + Step 1 + Table Mapping + + + + Step 2 + Data Mapping + + + + Step 3 + Import + + + + Step 4 + Download Excel + + + + Step 5 + Finish + + + +
+
+
+
+
+ + +
+
+

{{tableName}} Table

+

Update {{college.studentname}}

+
+ +
+ + +
+
+ + + +
+

{{ sheetName }}

+
+ + + + + + + + + + + +
{{ co }}
{{ item[key] }}
+
+
+
+
+ + + + + +
+ +
+
+
+
+ +
+ +
+
+ +
+
+

Table Mapping

+ +
+ +
+
+
+ + + + + + + + + + + + + +
Sheet NameTable Name
+ + + + +
+
+
+ + + + + + + +
+
+
+
+ +
+
+
+ +
+
+
+ + +
+
+

Data Mapping

+ +
+ +
+
+
+
+ Enable TransFormation + + +
+
+ + +
+
+ +
+
+
Add Rule line
+ + +
+
+ + +
+
+
+ + + + + + + +
+
+
+
+ +
+
+
+ +
+
+
+ + +
+
+

Importing Data

+ +
+
+
+
+ + +
+

{{ sheetName }}

+
+ + + + + + + + + + + +
{{ co }}
{{ item[key] }}
+
+
+
+ + + + + + +
+
+
+
+
+ + +
+
+

Download Excel

+
+
+
+ + + + +
+
+
+ +
+
+

File is Downloaded

+
+ + + +
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.scss new file mode 100644 index 0000000..a96c883 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.scss @@ -0,0 +1,110 @@ +.horizontal{ + width: 25%; + padding: 5px; +} +.horizontal1{ + width: 50%; + padding: 10px; +} +.middle{ + width: 33%; + padding: 10px; +} +.middle1{ + width: 75%; + padding: 10px; +} + +.full{ + width: 100%; + padding: 10px; +} + +// input[type=text],[type=date] { +// width: 100%; +// padding: 12px 20px; +// margin: 8px 0; +// display: inline-block; +// border: 1px solid #ccc; +// border-radius: 4px; +// box-sizing: border-box; +// } +// textarea +// { +// width: 100%; +// padding: 15px 15px; +// display: inline-block; +// border: 1px solid #ccc; +// border-radius: 4px; +// box-sizing: border-box; +// } + +.center{ + color: blue; +} +@media (max-width: 600px){ +.horizontal,.middle,.horizontal1,.middle1 { +width: 100%; +}} + + + .postColumn{ + border: 1px solid #ccc; + width: 78%; + margin-left: 15px; + } + .colName{ + text-align: center; + padding: 5px; + } + .fieldWrapper{ + margin-top: 20px; + } + + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.35rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + input[type=text],textarea { + width: 100%; + padding: 15px 15px; + // margin: 8px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + .required-field{ + color: red; + + } + .postColumn{ + border: 1px solid #ccc; + width: 78%; + margin-left: 15px; + } + .colName{ + text-align: center; + padding: 5px; + } + .colfields{ + border: 1px solid black; + margin: 17px; + text-align: center; + padding: 3px; + } + + select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.spec.ts new file mode 100644 index 0000000..5e4af86 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DatamananementworkflowComponent } from './datamananementworkflow.component'; + +describe('DatamananementworkflowComponent', () => { + let component: DatamananementworkflowComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DatamananementworkflowComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DatamananementworkflowComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.ts new file mode 100644 index 0000000..d1777ac --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/datamananementworkflow/datamananementworkflow.component.ts @@ -0,0 +1,555 @@ +import { HttpErrorResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { DatamanagementService } from 'src/app/services/fnd/datamanagement.service'; +import { ExcelService } from 'src/app/services/excel.service'; +import { BulkimportService } from 'src/app/services/fnd/bulkimport.service'; + +@Component({ + selector: 'app-datamananementworkflow', + templateUrl: './datamananementworkflow.component.html', + styleUrls: ['./datamananementworkflow.component.scss'] +}) +export class DatamananementworkflowComponent implements OnInit { + data; + getbyiddata; + id; + columns: any[]; + rows: any[]; + bodyrow: any[] = []; + getHeaderData; + JsonHeader = []; + rowdata; + transform: boolean = false; + checkTransform: boolean = true; + mapperText: string = ''; + changeKeyJson: any[]; + tableName; + + + + // Layout direction changing + + layout = { + direction: "horizontal", + block1: "clr-col-lg-12 clr-col-12 height container", + block2: "clr-col-lg-12 clr-col-12 container", + } + timelineStyle = { + step0: { state: "current", open: true, failed: false }, + step1: { state: "not-started", open: false, failed: false }, + step2: { state: "not-started", open: false, failed: false }, + step3: { state: "not-started", open: false, failed: false }, + step4: { state: "not-started", open: false, failed: false }, + step5: { state: "not-started", open: false, failed: false }, + }; + + json: string = ""; + luisApp = + { + name: '', + created: 1, + trained: 1, + tested: 1, + updated: 1, + published: 1, + + }; + constructor(private excel: ExcelService, private datamservice: DatamanagementService, private toastr: ToastrService, private router: Router, + private route: ActivatedRoute, public bulkUpload: BulkimportService) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + this.getall(); + this.getSheetName(this.id); + this.getById(this.id); + + this.getTableData(this.id); + // this.getColumns(this.tableName); + // this.getHeadersById(this.id); + + } + + getall() { + this.datamservice.getall().subscribe((data) => { + console.log(data); + this.data = data; + }) + } + + + getById(id) { + this.datamservice.getTemplateById(id).subscribe((data) => { + console.log(data); + this.getbyiddata = data; + this.tableName = data.entityName; + }); + } + headerData; + getColumns(table) { + console.log(table); + // console.log(this.getbyiddata.entityName); + this.bulkUpload.getColumnNames(table).subscribe((data) => { + console.log(data); + this.headerData = data; + }); + } + getHeadersById(id) { + console.log(this.columnJson); + this.bulkUpload.getHeader(id).subscribe((data) => { + console.log(data); + this.getHeaderData = JSON.stringify(data); + + // const objectArray = data.map(key => ({ + // headerName: key, + // value: "", + // })); + // // console.log(objectArray); + // this.getHeaderData = JSON.stringify(objectArray); + // console.log(this.getHeaderData); + + // const json = `{"Customer":[{"headerName":"balance","value":""},{"headerName":"c_status","value":""},{"headerName":"city","value":""},{"headerName":"country","value":""},{"headerName":"currency_code","value":""},{"headerName":"customer_id","value":""},{"headerName":"date_of_birth","value":""},{"headerName":"defaultsite_id","value":""}], + // "Site":[{"headerName":"balance","value":""},{"headerName":"city","value":""},{"headerName":"country","value":""},{"headerName":"credit_profile","value":""},{"headerName":"currency_code","value":""},{"headerName":"date_of_birth","value":""},{"headerName":"default_order_type","value":""},{"headerName":"dsa","value":""}]}` + // this.getHeaderData = json; + + }, (error) => { + console.log(error); + }); + + } + + selectedSheetName: string | null = null; + getHeaderbybutton(id, sheetName) { + // this.bulkUpload.getHeader(id,sheetName).subscribe((data) => { + // console.log(data); + // this.getHeaderData = data; + + // const objectArray = data.map(key => ({ + // headerName: key, + // value: "", + // })); + // // console.log(objectArray); + // this.getHeaderData = JSON.stringify(objectArray); + // console.log(this.getHeaderData); + + + + // },(error) => { + // console.log(error); + // }); + this.selectedSheetName = sheetName; + const columnEntry = this.columnJson.find(entry => entry.sheetName === sheetName); + if (columnEntry) { + const tablename = columnEntry.TableName; + this.getColumns(tablename); + } + } + + + checkData() { + console.log(this.JsonHeader); + console.log(this.mapperText); + } + + getkeychangesJson() { + + const jsonString = JSON.stringify(this.rows); + console.log("body", jsonString); + // const datajson = JSON.parse(this.datajson); + // this.datajson = [datajson]; + // console.log(this.datajson); + + this.bulkUpload.changeKeysOfJson(this.datajson, jsonString).subscribe((data) => { + console.log(data); + this.changeKeyJson = data.body; + }, (error: HttpErrorResponse) => { + console.log(error.error); + }); + } + // getHeaderskeychange() { + // let headers: string[] = []; + // if(this.changeKeyJson) { + // this.changeKeyJson.forEach((value) => { + // Object.keys(value).forEach((key) => { + // if(!headers.find((header) => header == key)){ + // headers.push(key) + // } + + // }) + + // }) + // } + // return headers; + // } + getHeaderskeychange(sheetName: string) { + if (this.changeKeyJson && this.changeKeyJson.length > 0 && this.changeKeyJson[0][sheetName]) { + // Assuming the first item in the array contains the keys. + return Object.keys(this.changeKeyJson[0][sheetName][0]); + } + return []; + } + + getkeychangeData(sheetName: string) { + if (this.changeKeyJson && this.changeKeyJson.length > 0 && this.changeKeyJson[0][sheetName]) { + // Returning the array of data. + return this.changeKeyJson[0][sheetName]; + } + return []; + } + // Change to Horizontal Layout + changeToHorizonTal() { + this.layout = { + direction: "horizontal", + block1: "clr-col-lg-12 clr-col-12 height container", + block2: "clr-col-lg-12 clr-col-12 container", + } + } + // Change to Vertical Layout + changeToVertical() { + this.layout = { + direction: "vertical", + block1: "clr-col-lg-3 clr-col-12 ", + block2: "clr-col-lg-9 clr-col-12 ", + } + } + reset() { + this.json = ""; + this.luisApp = + { + name: '', + trained: 1, + tested: 1, + updated: 1, + published: 1, + + + created: 1, + + }; + + this.timelineStyle = { + step0: { state: "current", open: true, failed: false }, + step1: { state: "not-started", open: false, failed: false }, + step2: { state: "not-started", open: false, failed: false }, + step3: { state: "not-started", open: false, failed: false }, + step4: { state: "not-started", open: false, failed: false }, + step5: { state: "not-started", open: false, failed: false }, + }; + } + + + //dynamic table + sheetNames: any; + getSheetName(id) { + this.bulkUpload.getSheetName(id).subscribe(data => { + console.log(data); + this.sheetNames = data; + }); + } + + getTableData(id) { + // console.log(this.getbyiddata.file_name); + this.bulkUpload.convertFileToJson(id).subscribe((data) => { + this.rows = data; + // this.bodyrow = data; + console.log(this.rows); + this.rowdata = [this.rows]; + this.rows = [this.rows] + console.log(typeof this.rows); + if (data) { + // this.toastr.success("Run Successfully") + } + var j; + var cart = []; + + for (var i = 0; i < data.length; i++) { + var columnsIn = data[i]; + if (i == 1) { + for (var key in columnsIn) { + j = { prop: key, name: key }; + cart.push(j) + + } + } + } + this.columns = cart; + + }); + } + // sheetNames = ['Customer', 'Site']; + getHeaders(sheetName: string) { + if (this.rows && this.rows.length > 0 && this.rows[0][sheetName]) { + // Assuming the first item in the array contains the keys. + return Object.keys(this.rows[0][sheetName][0]); + } + return []; + } + + getData(sheetName: string) { + if (this.rows && this.rows.length > 0 && this.rows[0][sheetName]) { + // Returning the array of data. + return this.rows[0][sheetName]; + } + return []; + } + + // getHeaders() { + // let headers: string[] = []; + // this.rows= [] + // if(this.rows) { + // this.rows.forEach((value) => { + // Object.keys(value).forEach((key) => { + // if(!headers.find((header) => header == key)){ + // headers.push(key) + // } + + // }) + + // }) + // } + // return headers; + // } + + //data mapping + checkTrans() { + + console.log("transform open") + // console.log(this.storeData); + if (this.getHeaderData) { + this.checkTransform = false; + this.transform = true; + console.log(this.getHeaderData); + if (this.mapperText === "undefined") { this.mapperText = ''; } + const currentText = this.mapperText; + let trnsfData = currentText + '' + this.getHeaderData; + this.mapperText = trnsfData; + } else { + this.checkTransform = true; + this.transform = false; + } + + } + mappperModal = false; + goFromMapper() { + this.mappperModal = true; + this.selectedSheetName = this.sheetNames[0]; + const tablename = this.columnJson[0].TableName; + this.getColumns(tablename) + if (this.mapperText) { + try { + this.JsonHeader = JSON.parse(this.mapperText); + console.log('Received data:', this.JsonHeader); + } catch (e) { console.error('Invalid JSON:', this.mapperText); } + } else + if (this.getHeaderData) { + // try { + // this.serverData = data.replace(/\[|\]|"/g, '').split(','); //(/\[|\]|'/g, '') //(/[\[\]"]/g, '') + // console.log('Received data:', this.serverData ); + // } catch (e) { console.error('Invalid JSON:', data);} + try { + this.JsonHeader = JSON.parse(this.getHeaderData); + console.log('Received data:', this.JsonHeader); + } catch (e) { console.error('Invalid JSON:', this.getHeaderData); } + + } + //this.mappperclick = true; + // this.router.navigate(["../../mapperTable/"], { relativeTo: this.route, queryParams: { id: this.updateId, data: this.nodeEditProperties.mappers, title:this.nodeEditProperties.title }, skipLocationChange: true}); + // console.log("gofrommapper",this.updateId,this.nodeEditProperties.mappers) + // if(this.mappperclick = true && this.datajson!= null){ + // this.nodeEditProperties.mappers = this.datajson; + // } + } + + transReset() { + this.mapperText = ''; + this.transform = false; + this.checkTransform = true; + } + + Rule: boolean = false; + checkRule: boolean = true; + RuleData: string = ''; + ruleModal = false; + RuleHeader = []; + + checkRules() { + console.log("rule line open") + this.ruleModal = true; + + + } + + rulechecking() { + if (this.RuleData) { + console.log(this.RuleData); + this.checkRule = false; + this.Rule = true; + } else { + this.Rule = false; + this.checkRule = true; + } + } + + mappperclick = false; + goFromRule() { + this.ruleModal = true; + if (this.RuleData) { + try { + this.RuleHeader = JSON.parse(this.RuleData); + console.log('Received data:', this.RuleHeader); + } catch (e) { console.error('Invalid JSON:', this.RuleData); } + } + console.log(this.RuleHeader); + } + + resetRule() { + this.RuleData = undefined; + this.RuleHeader = []; + this.Rule = false; + this.checkRule = true; + } + + onAddLines() { + this.RuleHeader.push({ + rulename: "", + fromsheet: "", + fromColumn: "", + validationTable: "", + checkColumn: "", + useColumn: "", + replacementTable: "", + replacementcolumn: "", + errormsg: "" + }); + } + deleteRow(index) { + this.RuleHeader.splice(index, 1); + } + + onRuleUpdate() { + this.ruleModal = false; + console.log("rule", this.RuleHeader); + let serverData = JSON.stringify(this.RuleHeader); + // console.log(serverData); + let product = JSON.stringify(serverData); + // console.log(product); + + try { + this.RuleData = JSON.parse(product); + console.log('Received rulejson data:', this.RuleData); + } catch (e) { console.error('Invalid JSON:', product); } + this.rulechecking() + } + + + datajson; + keychangeTable = false; + onUpdate() { + this.mappperModal = false; + console.log(this.JsonHeader); + let serverData = JSON.stringify(this.JsonHeader); + // console.log(serverData); + let product = JSON.stringify(serverData); + // console.log(product); + + try { + this.datajson = JSON.parse(product); + console.log('Received Newjson data:', this.datajson); + } catch (e) { console.error('Invalid JSON:', product); } + + this.mapperText = this.datajson; + + // const output = this.datajson.reduce((result, item) => { + // result[item.headerName] = item.value; + // return result; + // }, {}); + + // console.log(output); + + this.getkeychangesJson(); + this.keychangeTable = true; + } + + //download excel file + + selectedTable; + selectTable(val) { + this.selectedTable = val; + // this.downloadExcel(val); + } + + downloadExcel(id) { + console.log(this.changeKeyJson); + const jsonDataWithoutBrackets = this.changeKeyJson[0]; + console.log(jsonDataWithoutBrackets); + console.log(this.RuleHeader); + this.bulkUpload.downloadExcel(id, jsonDataWithoutBrackets, this.RuleHeader).subscribe( + (response: Blob) => { + // Process the downloaded Excel file + console.log(response); + // const file = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); + // const fileUrl = URL.createObjectURL(file); + // const link = document.createElement('a'); + // link.href = fileUrl; + // link.download = 'data.xlsx'; // Set the desired file name + // link.click(); + + // this.timelineStyle = { + // step0: { state: "success", open: false, failed: false }, + // step1: { state: "success", open: false, failed: false }, + // step2: { state: "success", open: false, failed: false }, + // step3: { state: "success", open: false, failed: false }, + // step4: { state: "current", open: true, failed: false }, + // }; + }, + (error) => { + // Handle error + console.log(error); + // this.timelineStyle = { + // step0: { state: "success", open: false, failed: false }, + // step1: { state: "success", open: false, failed: false }, + // step2: { state: "success", open: false, failed: false }, + // step3: { state: "current", open: true, failed: false }, + // step4: { state: "not-started", open: false, failed: false }, + // step5: { state: "not-started", open: false, failed: false }, + // }; + + } + ); + } + + getSheet(id) { + this.bulkUpload.getSheet(id).subscribe( + (response: Blob) => { + // Process the downloaded Excel file + console.log(response); + const file = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); + const fileUrl = URL.createObjectURL(file); + const link = document.createElement('a'); + link.href = fileUrl; + link.download = 'data.xlsx'; // Set the desired file name + link.click(); + + }); + } + + back() { + this.router.navigate(["../../datamanagement"], { relativeTo: this.route }); + } + + ////step 1 - mapping name + columnJson = [] + getColumnforstep1() { + + const objectArray = this.sheetNames.map(key => ({ + sheetName: key, + TableName: "", + })); + // console.log(objectArray); + this.columnJson = objectArray; + + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.spec.ts new file mode 100644 index 0000000..d63f2fa --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MappingruleComponent } from './mappingrule.component'; + +describe('MappingruleComponent', () => { + let component: MappingruleComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MappingruleComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MappingruleComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.ts new file mode 100644 index 0000000..f384d1f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingrule.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-mappingrule', + templateUrl: './mappingrule.component.html', + styleUrls: ['./mappingrule.component.scss'] +}) +export class MappingruleComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.html new file mode 100644 index 0000000..753e663 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.html @@ -0,0 +1,149 @@ +

Mapping Rule

+Add Mode
+Mapping Rules are proccessed while importing bulk records for respective entity +
+ + + + + + + + +
+ + + + + +
+
+
+ + + +
+
+ + +
+
+
+ +
+
+ + +
+ +
+ + + +
+
+ + +
+
Mapping Fields
+ +
+
+
+ + +
+
+
+ + + + + + + + + + + + + +
Header FieldsValue
+ + + +
+
+ + +
+ +
+
+
+ + +
+
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.scss new file mode 100644 index 0000000..b05187f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.scss @@ -0,0 +1,81 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + margin-top: 3px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.spec.ts new file mode 100644 index 0000000..8d28df0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MappingruleaddComponent } from './mappingruleadd.component'; + +describe('MappingruleaddComponent', () => { + let component: MappingruleaddComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MappingruleaddComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MappingruleaddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.ts new file mode 100644 index 0000000..cca1959 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleadd/mappingruleadd.component.ts @@ -0,0 +1,249 @@ +import { HttpErrorResponse, HttpHeaderResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { BulkimportService } from 'src/app/services/fnd/bulkimport.service'; + +@Component({ + selector: 'app-mappingruleadd', + templateUrl: './mappingruleadd.component.html', + styleUrls: ['./mappingruleadd.component.scss'] +}) +export class MappingruleaddComponent implements OnInit { + public entryForm: FormGroup; + selectedFile: File[]=[]; + + datajson; + transform:boolean = false; + checkTransform:boolean = true; + mapperdata; + + entityname; + description; + constructor(private _fb: FormBuilder, private router: Router,private toastr: ToastrService, + private route: ActivatedRoute,private dataservice:BulkimportService) { } + + ngOnInit(): void { + this.entryForm = this._fb.group({ + entity_name:[null], + mapping_rule:[null], + description: [null], + active: [true], + fileType: [null], + }); + + this.route.queryParams.subscribe(params => { + const data = params['data']; + this.entityname = params['name']; + this.description = params['description']; + + + if (data) { + try { + this.datajson = JSON.parse(data); + console.log('Received data:', this.datajson); + } catch (e) { console.error('Invalid JSON:', data);} + } + + + }); + + const condition = this.dataservice.getCondition(); + if(condition === 'mapper'){ + this.transform = true; + this.checkTransform = false; + if(this.datajson!== undefined){ + // if(this.entryForm.value.rule_line == 'undefined'){ this.entryForm.value.rule_line= '';} + const currentText = this.entryForm.value.rule_line = ''; + this.mapperdata = currentText + this.datajson; + // this.entryForm.value.rule_line = this.mapperdata; + // this.Updating(); + this.dataservice.setCondition(''); + } + } + + + console.log(this.entryForm.value); + + this.entryForm.patchValue({ + entity_name: this.entityname, + description: this.description, + }); + + console.log(this.entryForm.value); + } + + serverData = [ + { + }]; + onAddLines(){ + this.serverData.push({ + rulename: "", + fromsheet:"", + fromColumn: "", + validationTable: "", + checkColumn: "", + replacementcolumn:"", + useColumn:"", + errormsg:"" + }); + console.log(this.serverData); + } + deleteRow(index) { + this.serverData.splice(index, 1); + } + + toastrShown: boolean = false; + onSubmit(){ + this.entryForm.value.mapping_rule = JSON.stringify(this.serverData); + console.log(this.entryForm.value); + this.dataservice.saveMappingData(this.entryForm.value).subscribe((data)=>{ + console.log(data); + if (data) { + if (!this.toastrShown) { + this.toastrShown = true; // Set the flag to indicate that the toastr message has been shown + this.toastr.success("Added Successfully"); + setTimeout(() => { + this.router.navigate(["../all"], { relativeTo: this.route }); + }, 500); + } + } + }, (error: HttpHeaderResponse)=>{ + console.log(error); + if(error.status===202){ + this.toastr.success("Added Succesfully"); + } + if(error.status===404){ + this.toastr.error("Not Added"); + } + if(error.status===400){ + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.router.navigate(["../all"], { relativeTo: this.route }); + },500); + } + goback(){ + this.router.navigate(["../all"], { relativeTo: this.route }); + } + + + + headerData; + getColumns(table){ + console.log(table); + // console.log(this.getbyiddata.entityName); + this.dataservice.getColumnNames(table).subscribe((data) => { + console.log(data); + this.headerData = data; + }); +} + + checkTransformMapper = true; + transformMapper = false; + mapperText; + getHeaderData; + JsonHeader = []; + selectedSheetName: string | null = null; + columnJson =[]; + sheetNames:any; + checkTransMapper(){ + + console.log("Mapper open") + // console.log(this.storeData); + if(this.getHeaderData){ + this.checkTransformMapper = false; + this.transformMapper = true; + console.log(this.getHeaderData); + if(this.mapperText === "undefined"){ this.mapperText= '';} + const currentText = this.mapperText; + let trnsfData = currentText + '' +this.getHeaderData; + this.mapperText = trnsfData; + }else { + this.checkTransformMapper = true; + this.transformMapper = false; + } + + } + mappperModal = false; + goFromMapperField(){ + this.mappperModal = true; + this.selectedSheetName = this.sheetNames[0]; + const tablename = this.columnJson[0].TableName; + this.getColumns(tablename) + if(this.mapperText){ + try { + this.JsonHeader = JSON.parse(this.mapperText); + console.log('Received data:', this.JsonHeader ); + } catch (e) { console.error('Invalid JSON:', this.mapperText);} + }else + if (this.getHeaderData) { + // try { + // this.serverData = data.replace(/\[|\]|"/g, '').split(','); //(/\[|\]|'/g, '') //(/[\[\]"]/g, '') + // console.log('Received data:', this.serverData ); + // } catch (e) { console.error('Invalid JSON:', data);} + try { + this.JsonHeader = JSON.parse(this.getHeaderData); + console.log('Received data:', this.JsonHeader ); + } catch (e) { console.error('Invalid JSON:', this.getHeaderData);} + + } + } + + transResetMapper(){ + this.mapperText = ''; + this.transformMapper = false; + this.checkTransformMapper = true; + } + + onUpdate(){ + this.mappperModal = false; + } + + + getHeaderFieldData(){ + if(this.entryForm.value.entity_name){ + this.dataservice.getColumnNames(this.entryForm.value.entity_name).subscribe(data =>{ + console.log(data); + const objectArray = data.map(fieldname => ({ + headerName: fieldname, + value: "", + })); + // console.log(objectArray); + const headerdata= JSON.stringify(objectArray); + this.serverData = JSON.parse(headerdata); + }) + }else{ + this.toastr.warning("Entity Name is Required") + } + } + + chooseFile(event){ + console.log(event); + this.selectedFile = event.target.files[0]; + } + + valueofField; + getDDFieldData(){ + if(this.entryForm.value.fileType && this.selectedFile){ + this.dataservice.getDDforMappingRule(this.selectedFile,this.entryForm.value.fileType).subscribe(data =>{ + console.log(data); + this.valueofField = data.body; + },(error)=>{ + if(error.status === 404){ + this.toastr.error("Sheet not found") + } + if(error.status >= 500 && error.status <= 599){ + this.toastr.error("Server Error") + } + }) + }else{ + this.toastr.warning("Sheet name and file is required") + + } +} + + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.html new file mode 100644 index 0000000..8ee34a9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.html @@ -0,0 +1,85 @@ + + +
+ +
+
+
+

Mapping Rule

+
+
+ + + +
+
+ + + Loading ... +
{{error}}
+ + + Entity Name + + + Description + + + Active + + + File Type + + + Action + + + {{user.entity_name}} + {{user.description}} + {{user.active}} + {{user.fileType}} + + + + Delete + + + + + + + + + + + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.scss new file mode 100644 index 0000000..c05b1dc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.scss @@ -0,0 +1,4 @@ +.delete,.heading{ + text-align: center; + color: red; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.spec.ts new file mode 100644 index 0000000..bf59474 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MappingruleallComponent } from './mappingruleall.component'; + +describe('MappingruleallComponent', () => { + let component: MappingruleallComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MappingruleallComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MappingruleallComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.ts new file mode 100644 index 0000000..a204f3b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleall/mappingruleall.component.ts @@ -0,0 +1,85 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { ExcelService } from 'src/app/services/excel.service'; +import * as moment from 'moment'; +import { BulkimportService } from 'src/app/services/fnd/bulkimport.service'; +@Component({ + selector: 'app-mappingruleall', + templateUrl: './mappingruleall.component.html', + styleUrls: ['./mappingruleall.component.scss'] +}) +export class MappingruleallComponent implements OnInit { + loading = false; + error; + selected: any[] = []; + rowSelected :any= {}; + modaldelete=false; + data; + constructor(private router: Router, private toastr: ToastrService, + private route: ActivatedRoute,private excel: ExcelService,private bulkimportService:BulkimportService,) { } + + ngOnInit(): void { + this.getall(); + } + getall(){ + this.bulkimportService.getMappingDetails().subscribe((data)=>{ + console.log(data); + this.data=data; + if(this.data.length == 0){ + this.error="No data Available"; + console.log(this.error); + } + + },(error) => { + console.log(error); + if(error){ + this.error="No data Available OR server Error"; + } + }); + + } + goToAdd(){ + this.router.navigate(["../add"], { relativeTo: this.route }); + + } + onExport() { + this.excel.exportAsExcelFile(this.data, 'user_', + moment().format('YYYYMMDD_HHmmss')) + } + goToEdit(id) { + this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + + delete(id){ + this.modaldelete = false; + console.log("in delete "+id); + this.bulkimportService.deleteMappingById(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data == null || data) { + this.toastr.success('Deleted successfully'); + } + }, + (error) => { + console.log('Error in adding data...',+error); + if(isNaN(error)){ + this.toastr.success('Deleted successfully'); + }else{ + this.toastr.error('Not Deleted Data Getting Some Error'); + } + } + ); +} + +activeTab: number = 1; + +showTab(tabNumber: number) { + this.activeTab = tabNumber; +} +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.html b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.html new file mode 100644 index 0000000..6bdbd5a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.html @@ -0,0 +1,100 @@ +

Mapping Rule

+Edit Mode
+Mapping Rules are proccessed while importing bulk records for respective entity +
+
+
+
+
+ + +
+
+ + +
+
+
+ +
+
+ + +
+ +
+ + + +
+
+ + +
+
Mapping Fields
+ +
+
+
+ + +
+
+
+ + + + + + + + + + + + + +
Header FieldsValue
+ + + + + +
+
+
+ + +
+
+
+ + +
+
+ +
+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.scss b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.scss new file mode 100644 index 0000000..b05187f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.scss @@ -0,0 +1,81 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } + } + + .entry-pg { + width: 750px; + } + + .button1::after { + content: none; + } + .button1:hover::after { + content: "ADD ROWS"; + } + + $bg-color: #dddddd; + + .section { + background-color: $bg-color; + height: 40px; + } + + .section p { + //color: white; + font-weight: bold; + padding: 10px; + font-size: 18px; + } + + .clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; + } + + .center { + text-align: center; + } + input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + margin-top: 3px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + .required-field{ + color: red; + + } + select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.spec.ts new file mode 100644 index 0000000..2e79fd9 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MappingruleeditComponent } from './mappingruleedit.component'; + +describe('MappingruleeditComponent', () => { + let component: MappingruleeditComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MappingruleeditComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MappingruleeditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.ts b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.ts new file mode 100644 index 0000000..3239322 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/datamanagement/mappingrule/mappingruleedit/mappingruleedit.component.ts @@ -0,0 +1,161 @@ +import { HttpErrorResponse, HttpHeaderResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { BulkimportService } from 'src/app/services/fnd/bulkimport.service'; + +@Component({ + selector: 'app-mappingruleedit', + templateUrl: './mappingruleedit.component.html', + styleUrls: ['./mappingruleedit.component.scss'] +}) +export class MappingruleeditComponent implements OnInit { + public entryForm: FormGroup; + selectedFile: File[]=[]; + id; + datajson; + transform:boolean = false; + checkTransform:boolean = true; + mapperdata; + tdata: any = {}; + entityname; + description; + constructor(private _fb: FormBuilder, private router: Router,private toastr: ToastrService, + private route: ActivatedRoute,private dataservice:BulkimportService) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + + + this.dataservice.getMappingDetailsById(this.id).subscribe(data => { + this.tdata = data; + this.serverData = JSON.parse(data.mapping_rule); + console.log(this.tdata); + }, + (err) => { + console.log(err); + }); + + console.log(this.tdata); + // this.entryForm.patchValue({ + // entity_name: this.entityname, + // description: this.description, + // }); + // console.log(this.entryForm.value); + } + + getById(id: number) { + + } + + serverData = []; + + toastrShown: boolean = false; + onSubmit(){ + this.tdata.mapping_rule = JSON.stringify(this.serverData); + console.log(this.tdata); + this.dataservice.updateMappingData(this.tdata, this.id).subscribe((data)=>{ + console.log(data); + if (data.operationStatus) { + this.toastr.warning(data.operationMessage); + }else{ + if (!this.toastrShown) { + this.toastrShown = true; // Set the flag to indicate that the toastr message has been shown + this.toastr.success("Update Successfully"); + setTimeout(() => { + this.router.navigate(["../../all"], { relativeTo: this.route }); + }, 500); + } + } + }, (error: HttpHeaderResponse)=>{ + console.log(error); + if(error.status===202){ + this.toastr.success("Update Succesfully"); + } + if(error.status===404){ + this.toastr.error("Not Update"); + } + if(error.status===400){ + this.toastr.error("Not Update"); + } + }); + setTimeout(() => { + this.router.navigate(["../../all"], { relativeTo: this.route }); + },500); + } + + Updating(){ + console.log(this.tdata); + this.dataservice.updateData(this.tdata, this.id).subscribe(data=>{ + console.log(data); + // this.ngOnInit(); + }, (error: HttpHeaderResponse)=>{ + console.log(error); + }); + } + + goback(){ + this.router.navigate(["../../all"], { relativeTo: this.route }); + } + + + + headerData; + getColumns(table){ + console.log(table); + // console.log(this.getbyiddata.entityName); + this.dataservice.getColumnNames(table).subscribe((data) => { + console.log(data); + this.headerData = data; + }); +} + + + + getHeaderFieldData(){ + if(this.tdata.entity_name){ + this.dataservice.getColumnNames(this.tdata.entity_name).subscribe(data =>{ + console.log(data); + const objectArray = data.map(fieldname => ({ + headerName: fieldname, + value: "", + })); + // console.log(objectArray); + const headerdata= JSON.stringify(objectArray); + this.serverData = JSON.parse(headerdata); + }) + }else{ + this.toastr.warning("Entity Name is Required") + } + } + + showdropdown = false; + chooseFile(event){ + console.log(event); + this.selectedFile = event.target.files[0]; + if(event){ this.showdropdown = true;} + + } + + valueofField; + getDDFieldData(){ + if(this.tdata.fileType && this.selectedFile){ + this.dataservice.getDDforMappingRule(this.selectedFile,this.tdata.fileType).subscribe(data =>{ + console.log(data); + this.valueofField = data.body; + },(error)=>{ + if(error.status === 404){ + this.toastr.error("Sheet not found") + } + if(error.status >= 500 && error.status <= 599){ + this.toastr.error("Server Error") + } + }) + }else{ + this.toastr.warning("Sheet name and file is required") + } +} + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.html new file mode 100644 index 0000000..b29b64e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.html @@ -0,0 +1,354 @@ + +
+
+
+

Token registery

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + token name + + + + token + + + + + + Action + + + + + + {{user.token_name }} + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.ts new file mode 100644 index 0000000..9d0ecaf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.component.ts @@ -0,0 +1,251 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Token_registeryservice } from './Token_registery.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Token_registerycardvariable } from './Token_registery_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Token_registery', + templateUrl: './Token_registery.component.html', + styleUrls: ['./Token_registery.component.scss'] +}) +export class Token_registeryComponent implements OnInit { + cardButton = Token_registerycardvariable.cardButton; + cardmodeldata = Token_registerycardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Token_registerycardvariable.cardButton; + cardmodal; changeView() { + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine: any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Token_registery_formCode' + tableName = 'Token_registery'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Token_registeryservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; + // component button + ngOnInit(): void { + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + token_name: [null], + + token: [null], + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Token_registery_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; + this.product = [...this.product].reverse(); if (this.product.length == 0) { + this.error = "No Data Available" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; this.submitted = false; + + + + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + + rsModaltoken = false; + goToReplaceStringtoken(row) { + this.rowSelected = row; this.rsModaltoken = true; + } + + // updateaction +} + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.service.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.service.ts new file mode 100644 index 0000000..6fdf18c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +@Injectable({ + providedIn: 'root' +}) +export class Token_registeryservice { + private baseURL = "apiregistery"; + + constructor( + + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL + "/getall"); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL + "/generateToken", data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/delete/" + id; + return this.apiRequest.delete(_http); + } + + + + + // updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery_cardvariable.ts new file mode 100644 index 0000000..3062363 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/Token_registery/Token_registery_cardvariable.ts @@ -0,0 +1,4 @@ +export const Token_registerycardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/ApiRegistery.service.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/ApiRegistery.service.ts new file mode 100644 index 0000000..21f04cb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/ApiRegistery.service.ts @@ -0,0 +1,46 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +@Injectable({ + providedIn: 'root' +}) +export class ApiRegisteryservice { + private baseURL = "Api_registery_header/Api_registery_header"; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + + + + + + + + // updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.html new file mode 100644 index 0000000..e7e1514 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.html @@ -0,0 +1,382 @@ + +
+
+
+

ApiRegisteryLine

+
+
+ + + +
+
+ + + + Loading ... + +
{{error}}
+
+ + url + + + + method + + + + + + + + Action + + + + + + {{user.url }} + + + {{user.method }} + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
+ File Preview +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.scss new file mode 100644 index 0000000..c47b921 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.scss @@ -0,0 +1,78 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.ts new file mode 100644 index 0000000..5b060a1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.component.ts @@ -0,0 +1,230 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Apiregisterylineservice } from './Apiregisteryline.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Apiregisterylinecardvariable } from './Apiregisteryline_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +import { ActivatedRoute } from '@angular/router'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Apiregisteryline', + templateUrl: './Apiregisteryline.component.html', + styleUrls: ['./Apiregisteryline.component.scss'] +}) +export class ApiregisterylineComponent implements OnInit { + cardButton = Apiregisterylinecardvariable.cardButton; + cardmodeldata = Apiregisterylinecardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Apiregisterylinecardvariable.cardButton; + cardmodal; changeView() { + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine: any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Apiregisteryline_formCode'; + headerId; + tableName = 'Apiregisteryline'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, + private userInfoService: UserInfoService, + private mainService: Apiregisterylineservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + private route: ActivatedRoute, + ) { } + private editInterval: any; + // component button + ngOnInit(): void { + + this.headerId = this.route.snapshot.params["id"]; + console.log("headerId = ", this.headerId); + + if (this.cardmodeldata !== '') { + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole = this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ + url: [null], + + method: [null], + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Apiregisteryline_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + error; + getData() { + this.mainService.getAll(this.headerId).subscribe((data) => { + console.log(data); + this.product = data; + this.product = [...this.product].reverse(); if (this.product.length == 0) { + this.error = "No Data Available" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + this.entryForm.value.header_id = this.headerId; + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; this.submitted = false; + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + // updateaction +} + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.service.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.service.ts new file mode 100644 index 0000000..d0d929c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +@Injectable({ + providedIn: 'root' +}) +export class Apiregisterylineservice { + private baseURL = "Api_registery_line/Api_registery_line"; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(headerId: number, page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL + "/header/" + headerId); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + // updateaction +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline_cardvariable.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline_cardvariable.ts new file mode 100644 index 0000000..d7b2860 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/Apiregisteryline/Apiregisteryline_cardvariable.ts @@ -0,0 +1,4 @@ +export const Apiregisterylinecardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.html new file mode 100644 index 0000000..3c293d8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.html @@ -0,0 +1 @@ +

addapiregistery works!

diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.spec.ts new file mode 100644 index 0000000..a06237c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddapiregisteryComponent } from './addapiregistery.component'; + +describe('AddapiregisteryComponent', () => { + let component: AddapiregisteryComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [AddapiregisteryComponent] + }); + fixture = TestBed.createComponent(AddapiregisteryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.ts new file mode 100644 index 0000000..f4cd146 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/addapiregistery/addapiregistery.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-addapiregistery', + templateUrl: './addapiregistery.component.html', + styleUrls: ['./addapiregistery.component.scss'] +}) +export class AddapiregisteryComponent { + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.html new file mode 100644 index 0000000..114e7d5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.html @@ -0,0 +1,172 @@ + + +
+
+
+

API-Registery - {{getFormCode}}

+
+
+ + + +
+
+ + + Loading ... +
{{error}}
+
+ + + + + Table Name + + + + Action + + + + + + + + + {{user.table_name}} + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+ + + +
+ + + + + + + + + +
Field Name: {{user.field_name}}
+
+
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.scss new file mode 100644 index 0000000..8d27434 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.scss @@ -0,0 +1,5 @@ +@import '../../../../../../styles1.scss'; +.delete,.heading{ + text-align: center; + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.spec.ts new file mode 100644 index 0000000..1188923 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AllapiregisteryComponent } from './allapiregistery.component'; + +describe('AllapiregisteryComponent', () => { + let component: AllapiregisteryComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [AllapiregisteryComponent] + }); + fixture = TestBed.createComponent(AllapiregisteryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.ts new file mode 100644 index 0000000..70425b0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/allapiregistery/allapiregistery.component.ts @@ -0,0 +1,299 @@ + +import { Component, OnInit, TemplateRef, ViewChild, ViewEncapsulation, } from '@angular/core'; +import { ActivatedRoute, Router } from "@angular/router"; + +import { ToastrService } from 'ngx-toastr'; +import { ExtensionField } from "src/app/models/fnd/ExtensionField"; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; + +//import { Teacher } from "src/app/pages/university/teacher/Teacher"; +import { UserInfoService } from "src/app/services/user-info.service"; +import { ApiRegisteryservice } from '../ApiRegistery.service'; +import { FormBuilder, FormGroup } from '@angular/forms'; + +interface Rows { + + id: number; + url: string; + method: string; + header_id: number; +} +@Component({ + selector: 'app-allapiregistery', + templateUrl: './allapiregistery.component.html', + styleUrls: ['./allapiregistery.component.scss'] +}) +export class AllapiregisteryComponent implements OnInit { + @ViewChild("extById") extensionById: TemplateRef; + @ViewChild("showInGrid") txId: TemplateRef; + + //@ViewChild("filter") filter: ElementRef; + basic: boolean = false; + // whoColumns: Teacher; // who columns data + alldata: any; + userrole; + columns: any[]; + rows: Rows[]; + temp = []; + rowSelected: any = {}; + modaldelete = false; + modalEdit = false; + modalAdd = false; + public entryForm: FormGroup; + loading = false; + error; + selected: any[] = []; + filterData: string; + isLoading: boolean = false; + extensionField: ExtensionField[] = []; + constructor(private router: Router, + private route: ActivatedRoute, + private toastr: ToastrService, + private extensionService: ExtensionService, + private apiregistery: ApiRegisteryservice, + private userInfoService: UserInfoService, + private _fb: FormBuilder, + ) { } + + private account_id: any; + // private formCode: any; + formCode: string; + getFormCode; + public key: string = "formCode"; + public storage: Storage = sessionStorage; + ngOnInit(): void { + this.route.queryParams.subscribe(params => { + this.getFormCode = params['formCode']; + console.log("formCode ", this.getFormCode); + this.storage.setItem("formCode", this.getFormCode); // Store the value in sessionStorage using the key + }); + + + this.account_id = this.userInfoService.getUserId(); + this.formCode = this.storage.getItem(this.key); + console.log("[ngOnInit] acc_id: " + this.account_id + " formCode: " + this.formCode); + this.getData(); + // this.columns = [ + // /* { prop: "id", name: "Actions", width: 65, cellTemplate: this.extensionById }, */ + // { prop: "field_name", name: "Field Name", width: 120 }, + // { prop: "mapping", name: "Mapping", width: 150 }, + // { prop: "data_type", name: "Data Type", width: 190 }, + // /* { prop: "id", name: "Show In Grid", width: 90, cellTemplate: this.txId } */ + // ]; + + this.entryForm = this._fb.group({ + table_name: [null], + }); + + this.userrole = this.userInfoService.getRoles(); + + } + getData() { + this.apiregistery.getAll().subscribe((data) => { + this.alldata = data + console.log(' get all ', this.alldata); + if (this.alldata.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) + } + + alertType: string; + alertMessage: string = ""; + alert = [ + { type: "success", message: "Build Successfully" }, + { type: "danger", message: "Some error Happens" }, + ]; + + // buildExtension(id, accountID) { + // console.log("buildExtension() Account id = " + this.account_id + " Form Code = ", + // this.formCode); + // if (this.account_id === null && this.formCode === null) { + // this.alertType = this.alert[1].type; + // this.alertMessage = "form_code is null"; + // return; + // } + // this.extensionService + // .buildExtension(id, accountID, this.formCode) + // .subscribe( + // (data) => { + // console.log("build successfully ", data); + // this.alert.forEach((e) => { + // if (e.type === "success") { + // this.alertType = e.type; + // this.alertMessage = e.message; + // } //data.type === true : e.message ? e.message + + // }); + // // go to parent entry form... + // //this.router.navigate(['../../'], { relativeTo: this.route.parent }); + + // if (data) { + // this.toastr.success("Build successfully"); + // } + + + // }, + // (err) => { + + // if (err) { + // this.toastr.error("Build Not Successful"); + // } + // console.log("build failed ", err); + // this.alertType = this.alert[1].type; + // this.alertMessage = this.alert[1].message; + // } + // ); + // } + + // isChecked(id: number) { + // return ( + // this.extensionField.find(c => { + // if (c.id === id) return c.isActive; + // }) !== undefined + // ); + // } + + // chk(checked) { + // console.log(checked); + // return !checked; + // } + + // extField: ExtensionField; + // checked: boolean; + // toggle(id: number) { + // console.log(id); + // this.extensionService.getById(id).subscribe(ext => { + // this.extField = ext; + // this.checked = ext.isActive; + // console.log('extField ', this.extField); + // console.log('checked ', this.checked); + // }); + // console.log(this.extField.isActive); + // //this.extensionService.update(id,this.extField).subscribe(); + // } + + goToEdit(row) { + this.rowSelected = row; + + this.modalEdit = true; + } + + onUpdate(id) { + this.modalEdit = false; + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.apiregistery.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + onCreate() { + this.modalAdd = false; + this.apiregistery.create(this.entryForm.value).subscribe( + (data) => { + console.log('after add ', data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + setTimeout(() => { + this.ngOnInit(); + }, 500); + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { + this.modalAdd = true; + this.submitted = false; + + } + submitted = false; + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + } this.onCreate(); + + } + + + // goToAdd() { + // this.router.navigate(["../add"], { relativeTo: this.route }); + // } + // goToEdit(id: number) { + // this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + // } + + goToWhoColumns(id: number) { + this.basic = !this.basic; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.extensionService.delete(id).subscribe((data) => { + console.log(data); + this.ngOnInit(); + if (data.body) { + this.toastr.success('Deleted successfully'); + } + }, (error) => { + console.log('Error in adding data...', +error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + }); + } + + + gotoline(id: any) { + this.router.navigate(["../line/" + id], { relativeTo: this.route }) + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.html new file mode 100644 index 0000000..0680b43 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.html @@ -0,0 +1 @@ + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.spec.ts new file mode 100644 index 0000000..56bfcc0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ApiregisteryComponent } from './apiregistery.component'; + +describe('ApiregisteryComponent', () => { + let component: ApiregisteryComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [ApiregisteryComponent] + }); + fixture = TestBed.createComponent(ApiregisteryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.ts new file mode 100644 index 0000000..3abcf3c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/apiregistery.component.ts @@ -0,0 +1,214 @@ +// import { Component } from '@angular/core'; + +// @Component({ +// selector: 'app-apiregistery', +// templateUrl: './apiregistery.component.html', +// styleUrls: ['./apiregistery.component.scss'] +// }) +// export class ApiregisteryComponent { + +// } +import { Component, OnInit, TemplateRef, ViewChild, ViewEncapsulation, } from '@angular/core'; +import { ActivatedRoute, Router } from "@angular/router"; + +import { ToastrService } from 'ngx-toastr'; +import { ExtensionField } from "src/app/models/fnd/ExtensionField"; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +//import { Teacher } from "src/app/pages/university/teacher/Teacher"; +import { UserInfoService } from "src/app/services/user-info.service"; + +interface Rows { + id: number; + field_name: any; + mapping: any; + data_type: any; + isActive: any; +} +@Component({ + selector: 'app-apiregistery', + templateUrl: './apiregistery.component.html', + styleUrls: ['./apiregistery.component.scss'] +}) +export class ApiregisteryComponent implements OnInit { + @ViewChild("extById") extensionById: TemplateRef; + @ViewChild("showInGrid") txId: TemplateRef; + + //@ViewChild("filter") filter: ElementRef; + basic: boolean = false; + // whoColumns: Teacher; // who columns data + columns: any[]; + rows: Rows[]; + temp = []; + rowSelected: any = {}; + modaldelete = false; + loading = false; + error; + selected: any[] = []; + filterData: string; + isLoading: boolean = false; + extensionField: ExtensionField[] = []; + constructor(private router: Router, + private route: ActivatedRoute, + private toastr: ToastrService, + private extensionService: ExtensionService, + private userInfoService: UserInfoService) { } + + private account_id: any; + // private formCode: any; + formCode: string; + getFormCode; + public key: string = "formCode"; + public storage: Storage = sessionStorage; + ngOnInit(): void { + this.route.queryParams.subscribe(params => { + this.getFormCode = params['formCode']; + console.log("formCode ", this.getFormCode); + this.storage.setItem("formCode", this.getFormCode); // Store the value in sessionStorage using the key + }); + + + this.account_id = this.userInfoService.getUserId(); + this.formCode = this.storage.getItem(this.key); + console.log("[ngOnInit] acc_id: " + this.account_id + " formCode: " + this.formCode); + this.getData(); + this.columns = [ + /* { prop: "id", name: "Actions", width: 65, cellTemplate: this.extensionById }, */ + { prop: "field_name", name: "Field Name", width: 120 }, + { prop: "mapping", name: "Mapping", width: 150 }, + { prop: "data_type", name: "Data Type", width: 190 }, + /* { prop: "id", name: "Show In Grid", width: 90, cellTemplate: this.txId } */ + ]; + } + getData() { + this.isLoading = true; + //this.extensionField = new ExtensionField(); + this.extensionService.getAll().subscribe((data) => { + this.isLoading = false; + console.log(data); + // this.extensionField = data; + if (this.formCode === 'undefined' || this.formCode === undefined || this.formCode === null) { + this.extensionField = data; + } else { + this.extensionField = data.filter(item => item.form_code === this.formCode); + console.log(this.extensionField); + } + this.rows = this.extensionField; + if (this.extensionField.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + //this.temp = [...this.extensionField]; + }, (error) => { + console.log(error); + if (error) { + this.error = "No data Available OR server Error"; + } + }); + } + + alertType: string; + alertMessage: string = ""; + alert = [ + { type: "success", message: "Build Successfully" }, + { type: "danger", message: "Some error Happens" }, + ]; + + buildExtension(id, accountID) { + console.log("buildExtension() Account id = " + this.account_id + " Form Code = ", + this.formCode); + if (this.account_id === null && this.formCode === null) { + this.alertType = this.alert[1].type; + this.alertMessage = "form_code is null"; + return; + } + this.extensionService + .buildExtension(id, accountID, this.formCode) + .subscribe( + (data) => { + console.log("build successfully ", data); + this.alert.forEach((e) => { + if (e.type === "success") { + this.alertType = e.type; + this.alertMessage = e.message; + } //data.type === true : e.message ? e.message + + }); + // go to parent entry form... + //this.router.navigate(['../../'], { relativeTo: this.route.parent }); + + if (data) { + this.toastr.success("Build successfully"); + } + + + }, + (err) => { + + if (err) { + this.toastr.error("Build Not Successful"); + } + console.log("build failed ", err); + this.alertType = this.alert[1].type; + this.alertMessage = this.alert[1].message; + } + ); + } + + isChecked(id: number) { + return ( + this.extensionField.find(c => { + if (c.id === id) return c.isActive; + }) !== undefined + ); + } + + chk(checked) { + console.log(checked); + return !checked; + } + + extField: ExtensionField; + checked: boolean; + toggle(id: number) { + console.log(id); + this.extensionService.getById(id).subscribe(ext => { + this.extField = ext; + this.checked = ext.isActive; + console.log('extField ', this.extField); + console.log('checked ', this.checked); + }); + console.log(this.extField.isActive); + //this.extensionService.update(id,this.extField).subscribe(); + } + + goToAdd() { + this.router.navigate(["../add"], { relativeTo: this.route }); + } + goToEdit(id: number) { + this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + + goToWhoColumns(id: number) { + this.basic = !this.basic; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.extensionService.delete(id).subscribe((data) => { + console.log(data); + this.ngOnInit(); + if (data.body) { + this.toastr.success('Deleted successfully'); + } + }, (error) => { + console.log('Error in adding data...', +error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + }); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.html new file mode 100644 index 0000000..e0fb3d3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.html @@ -0,0 +1 @@ +

editapiregistery works!

diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.spec.ts new file mode 100644 index 0000000..8eece98 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditapiregisteryComponent } from './editapiregistery.component'; + +describe('EditapiregisteryComponent', () => { + let component: EditapiregisteryComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [EditapiregisteryComponent] + }); + fixture = TestBed.createComponent(EditapiregisteryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.ts new file mode 100644 index 0000000..3ea304c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/apiregistery/editapiregistery/editapiregistery.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-editapiregistery', + templateUrl: './editapiregistery.component.html', + styleUrls: ['./editapiregistery.component.scss'] +}) +export class EditapiregisteryComponent { + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.html new file mode 100644 index 0000000..e643f0a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.html @@ -0,0 +1,375 @@ + +
+ + +
+
+

{{ item?.charttitle }}

+

+ + 0 +

+
+
+
+ + + + +
+ + + +
+
+

{{item?.charttitle}}

+ + +
+
+
+ +
+
+

{{item?.charttitle}}

+ + +
+
+
+ +
+
+

{{item?.charttitle}}

+ + +
+
+
+ +
+
+

{{item?.charttitle}}

+ + +
+
+
+ +
+
+

{{item?.charttitle}}

+ + +
+
+
+ +
+
+

{{item?.charttitle}}

+ + +
+
+
+ +
+
+

{{item?.charttitle}}

+ + +
+
+
+ +
+
+

{{item?.charttitle}}

+ + +
+
+
+ +
+
+

{{item?.charttitle}}

+ + +
+
+
+
+
+ + + + + +
+ + + + +
+ + +
+
+ + Avatar + + + + + {{not.notification}} + + {{ not.time | timePipe }} +
+
+
+
+
+ + + +
+ + + +
+
+
+
+
+
+
+ {{app.owner}} {{app.accessibility ? 'private' : 'public'}} +
+
+ +
+
+
+ {{app.projectName}} +
+
+
+ {{app.description ? app.description : 'project description'}} +
+
+ + +
+
+
+
+ + {{tech}} + +
+ +
+
+
+ + +
+ +
+
+
+
+
+
+
+
+
+ + + +
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.scss new file mode 100644 index 0000000..5d88af5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.scss @@ -0,0 +1,73 @@ +//@import '../../../assets/scss/var'; + +h4{margin-top: 16px;} +.s-order-dash-pg { + margin: 0px; + display:flex; + flex-wrap:wrap; + flex-direction:row; + justify-content:center; + overflow: auto; + overflow-x: hidden; + .chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + max-height: 200px; + + } +} + +.chart-box{ + margin:16px; + padding:0 16px; + background-color: #fff; + border:1px solid #ccc; + border-radius: 2px; + max-width: 400px auto; + overflow: auto; + max-height: 300px auto; + + +} +#word{ + // width: 270px; + width:260px +} +.center{ + text-align: center; + font-weight: 500; +} +.s{ + color: blue; +} + +li{ + list-style-type: none; +} +.progress-bar{ + margin-bottom: 5px; + height: 15px; +} +.tag-input { + width: 100%; + padding: 0px 15px; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + } + + clr-combobox-container{ + padding-top: 0px !important; + padding-bottom:0px !important; + } + clr-combobox{ + width: 100%; + padding: 5px 5px; + // border: 1px solid #ccc; + border-radius: 4px; + } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.spec.ts new file mode 100644 index 0000000..5ec4ff8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardComponent } from './dashboard.component'; + +describe('DashboardComponent', () => { + let component: DashboardComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ DashboardComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(DashboardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.ts new file mode 100644 index 0000000..653ea4b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/dashboard/dashboard.component.ts @@ -0,0 +1,106 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { DashboardService } from 'src/app/services/builder/dashboard.service'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; + +@Component({ + selector: 'app-dashboard', + templateUrl: './dashboard.component.html', + styleUrls: ['./dashboard.component.scss'] +}) +export class DashboardComponent implements OnInit { + + data: any; + rows: any[]; + error; + chartData: any; + + constructor(private dashboard3Service: Dashboard3Service, + private dashboardService: DashboardService,) { } + + ngOnInit(): void { + this.getAllDash(); + this.getdashboard(); + } + dashboardModel; + dashboard_name; + getAllDash(){ + this.dashboard3Service.getDynamicDashDetails().subscribe(data => { + console.log(data); + const dash = data[0].model; + this.dashboardModel= JSON.parse(dash) ; + this.dashboard_name = data.dashboard_name; + + for (let i = 0; i < this.dashboardModel.length; i++) { + if(this.dashboardModel[i]?.charturl){ + this.dashboard3Service.getChartData(this.dashboardModel[i].charturl,this.dashboardModel[i].name).subscribe(tData => { + console.log(tData); + this.dashboardModel[i].featchData = tData; + }); + } + } + console.log(this.dashboardModel); + }); + } + + lineChartData: any[] = []; + radarChartData: any[] = []; + bubbleChartData: any[] = []; + dashboardChartData; + + getdashboard() { + this.chartData = []; + this.radarChartData = []; + this.bubbleChartData = []; + this.lineChartData = []; + this.dashboardService.getAllDash().subscribe( + (data) => { + this.data = data; + const filteredData = this.data.filter(item => item.add_to_home); + + this.rows = filteredData; + + if (filteredData.length === 0) { + this.error = "No data available with add_to_home set to true."; + } else { + this.error = ""; + } + + this.rows.forEach(item => { + if (item['dashbord1_Line'] && Array.isArray(item['dashbord1_Line']) && item['dashbord1_Line'].length > 0) { + item['dashbord1_Line'].forEach(dashboardLineItem => { + if (dashboardLineItem.model) { + const parsedModel = JSON.parse(dashboardLineItem.model); + this.chartData.push(parsedModel); + + this.dashboardChartData = this.chartData[0]?.dashboard; // Add a check here + + // if (this.dashboardChartData) { + for (let i = 0; i < this.dashboardChartData.length; i++) { + console.log(this.dashboardChartData[i]?.charturl); + if (this.dashboardChartData[i]?.charturl) { + this.dashboard3Service.getUrlChartData(this.dashboardChartData[i].table, this.dashboardChartData[i].name, this.dashboardChartData[i].xAxis,this.dashboardChartData[i].yAxis, this.dashboardChartData[i].datastore, this.dashboardChartData[i].charturl + ).subscribe(tData => { + console.log(tData); + this.dashboardChartData[i].featchData = tData; + }); + } + // } + + console.log(this.dashboardChartData); + + // this.lineChartData.push({ data: parsedModel.data, label: dashboardLineItem.name }); + console.log(dashboardLineItem.model); + } + } + }); + } + }); + }, + (error) => { + console.error('Error fetching dashboard data:', error); + }); + + console.log("Chart Data:", this.chartData); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.css b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.css new file mode 100644 index 0000000..eb2be77 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.css @@ -0,0 +1,39 @@ +.button1::after { + content: none; +} + +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + background-color: rgb(255, 255, 255); + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +.center { + text-align: center; +}/*# sourceMappingURL=addextension.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.css.map new file mode 100644 index 0000000..922569c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["addextension.component.scss","addextension.component.css"],"names":[],"mappings":"AAEA;EACE,aAAA;ACDF;;ADGA;EACE,mBAAA;ACAF;;ADGA;EACE,yBAVS;EAWT,YAAA;ACAF;;ADGA;EAEE,aAAA;EACA,eAAA;ACDF;;ADIA;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,oCAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACDF;;ADGA;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACAF;;ADEA;EACE,kBAAA;ACCF","file":"addextension.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.html new file mode 100644 index 0000000..263ceaf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.html @@ -0,0 +1,52 @@ +

Extension Field

+Add Mode
+
+ +
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ +
+
+
+ + + + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.scss new file mode 100644 index 0000000..1a7e044 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.scss @@ -0,0 +1,39 @@ +$bg-color: #dddddd; + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: $bg-color; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + background-color:rgb(255, 255, 255); + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +.center { + text-align: center; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.spec.ts new file mode 100644 index 0000000..9ab8763 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddextensionComponent } from './addextension.component'; + +describe('AddextensionComponent', () => { + let component: AddextensionComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AddextensionComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AddextensionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.ts new file mode 100644 index 0000000..874fb4a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/addextension/addextension.component.ts @@ -0,0 +1,94 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +@Component({ + selector: 'app-addextension', + templateUrl: './addextension.component.html', + styleUrls: ['./addextension.component.scss'] +}) +export class AddextensionComponent implements OnInit { + public extFieldForm: FormGroup; + submitted = false; + basic:boolean = true; + + isActive: boolean = true; + + formCode: string; + // GET FORM_CODE FROM SESSION + public key:string="formCode"; + public storage:Storage = sessionStorage; + + types:string[] = ['header', 'line']; + lookup_values: string[] = []; // come from server + lookups: string[] =[ + 'extn1', 'extn2', 'extn3', 'extn4', 'extn5', + 'extn6', 'extn7', 'extn8', 'extn9', 'extn10', + 'extn11', 'extn12', 'extn13', 'extn14', 'extn15' + ]; + datatype_values: string[] = []; // come from server + datatypes: string[] = ['textfield', 'longtext', 'date', 'checkbox', 'radiobutton', 'autocomplete']; + constructor( private _fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private extensionService: ExtensionService,) { } + + ngOnInit(): void { + this.formCode = this.storage.getItem(this.key); + console.log('form_code in ext : ', this.formCode); + + this.extFieldForm = this._fb.group({ + type: [null, [Validators.required]], // HO + field_name: [null, [Validators.required]], // label name + mapping: [null, [Validators.required]], // ext1 + data_type: [null, [Validators.required]], // txt, datw + form_code: [this.formCode], // should come from session + // isActive: [true] + active: [true] + }); + } + getLookupValues() { + this.extensionService.getLookupValues().subscribe(data => { + console.log('Lookup: ',data); + this.lookup_values = data; + }); + } + + getDataTypeValues() { + this.extensionService.getDataTypeValues().subscribe(data => { + console.log('data_type: ', data); + this.datatype_values = data; + }); + } + + onSubmit() { + console.log(this.extFieldForm.value); + this.basic = !this.basic; + this.submitted = true; + if (this.extFieldForm.invalid) { + return; + } + this.onCreate(); + //this.router.navigate(["../all"], { relativeTo: this.route }); + } + + onCreate() { + this.extensionService.create(this.extFieldForm.value).subscribe( + (data) => { + console.log('data save successfully', data); + this.router.navigate(["../all"], { relativeTo: this.route, queryParams: { formCode: this.formCode }}); + //this.router.navigate(['all'], { relativeTo: this.route.parent }); + }, + (error) => { + console.log(error); + this.router.navigate(["../all"], { relativeTo: this.route, queryParams: { formCode: this.formCode }}); + } + ); + } + + close() { + this.basic = !this.basic; + this.router.navigate(["../all"], { relativeTo: this.route }); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.css b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.css new file mode 100644 index 0000000..03b630f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.css @@ -0,0 +1,64 @@ +input[type=text], [type=date], [type=password] { + width: 100%; + padding: 15px 20px; + background-color: rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +.required-field { + color: red; + font-size: 18px; +} + +.green { + background-color: rgb(156, 231, 156); + color: black; +} + +.blue { + background-color: #57abcf; + color: black; +} + +.td-title { + text-align: center; + width: 150px; + color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); +} + +th { + background-color: rgb(170, 169, 169); + font-weight: bold; +} + +.td-content { + text-align: left; +} + +.delete, .heading { + text-align: center; + color: red; +} + +.section p { + background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +.delete, .heading { + text-align: center; + color: red; +}/*# sourceMappingURL=allextension.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.css.map new file mode 100644 index 0000000..7b2d262 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../../styles1.scss","allextension.component.css","allextension.component.scss"],"names":[],"mappings":"AAAA;EACE,WAAA;EACA,kBAAA;EAED,oCAAA;EACC,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACAF;;ADEA;EACE,UAAA;EACF,eAAA;ACCA;;ADEA;EACE,oCAAA;EACA,YAAA;ACCF;;ADCA;EACE,yBAAA;EACA,YAAA;ACEF;;ADAA;EACE,kBAAA;EACA,YAAA;EACF,YAAA;EACE,iBAAA;EACA,2CAAA;ACGF;;ADAA;EACE,oCAAA;EACA,iBAAA;ACGF;;ADDA;EACE,gBAAA;ACIF;;ADFA;EACE,kBAAA;EACA,UAAA;ACKF;;ADHA;EACA,oCAAA;EACE,aAAA;EACA,eAAA;ACMF;;ADHA;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACMF;;ACzDA;EACE,kBAAA;EACA,UAAA;AD4DF","file":"allextension.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.html new file mode 100644 index 0000000..52701f7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.html @@ -0,0 +1,101 @@ + + +
+
+
+

Form-Extension - {{getFormCode}}

+
+
+ + + +
+
+ + + Loading ... +
{{error}}
+ + + + + + Go To + + + Field Name + + + Mapping + + + Data Type + + + Action + + + + + + + Build + + {{user.field_name}} + {{user.mapping}} + {{user.data_type}} + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
Field Name: {{user.field_name}}
+
+
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+
+ + + + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.scss new file mode 100644 index 0000000..8d27434 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.scss @@ -0,0 +1,5 @@ +@import '../../../../../../styles1.scss'; +.delete,.heading{ + text-align: center; + color: red; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.spec.ts new file mode 100644 index 0000000..342426c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AllextensionComponent } from './allextension.component'; + +describe('AllextensionComponent', () => { + let component: AllextensionComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AllextensionComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AllextensionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.ts new file mode 100644 index 0000000..7dfdd6f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/allextension/allextension.component.ts @@ -0,0 +1,204 @@ +import { Component, OnInit, TemplateRef, ViewChild, ViewEncapsulation, } from '@angular/core'; +import { ActivatedRoute, Router } from "@angular/router"; + +import { ToastrService } from 'ngx-toastr'; +import { ExtensionField } from "src/app/models/fnd/ExtensionField"; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +//import { Teacher } from "src/app/pages/university/teacher/Teacher"; +import { UserInfoService } from "src/app/services/user-info.service"; + +interface Rows { + id: number; + field_name: any; + mapping: any; + data_type: any; + isActive: any; +} +@Component({ + selector: 'app-allextension', + templateUrl: './allextension.component.html', + styleUrls: ['./allextension.component.scss'] +}) +export class AllextensionComponent implements OnInit { + @ViewChild("extById") extensionById: TemplateRef; + @ViewChild("showInGrid") txId: TemplateRef; + + //@ViewChild("filter") filter: ElementRef; + basic: boolean = false; + // whoColumns: Teacher; // who columns data + columns: any[]; + rows: Rows[]; + temp = []; + rowSelected: any = {}; + modaldelete = false; + loading = false; + error; + selected: any[] = []; + filterData: string; + isLoading: boolean = false; + extensionField: ExtensionField[] = []; + constructor(private router: Router, + private route: ActivatedRoute, + private toastr: ToastrService, + private extensionService: ExtensionService, + private userInfoService: UserInfoService) { } + + private account_id: any; + // private formCode: any; + formCode: string; + getFormCode; + public key: string = "formCode"; + public storage: Storage = sessionStorage; + ngOnInit(): void { + this.route.queryParams.subscribe(params => { + this.getFormCode = params['formCode']; + console.log("formCode ", this.getFormCode); + this.storage.setItem("formCode", this.getFormCode); // Store the value in sessionStorage using the key + }); + + + this.account_id = this.userInfoService.getUserId(); + this.formCode = this.storage.getItem(this.key); + console.log("[ngOnInit] acc_id: " + this.account_id + " formCode: " + this.formCode); + this.getData(); + this.columns = [ + /* { prop: "id", name: "Actions", width: 65, cellTemplate: this.extensionById }, */ + { prop: "field_name", name: "Field Name", width: 120 }, + { prop: "mapping", name: "Mapping", width: 150 }, + { prop: "data_type", name: "Data Type", width: 190 }, + /* { prop: "id", name: "Show In Grid", width: 90, cellTemplate: this.txId } */ + ]; + } + getData() { + this.isLoading = true; + //this.extensionField = new ExtensionField(); + this.extensionService.getAll().subscribe((data) => { + this.isLoading = false; + console.log(data); + // this.extensionField = data; + if (this.formCode === 'undefined' || this.formCode === undefined || this.formCode === null) { + this.extensionField = data; + } else { + this.extensionField = data.filter(item => item.form_code === this.formCode); + console.log(this.extensionField); + } + this.rows = this.extensionField; + if (this.extensionField.length == 0) { + this.error = "No data Available"; + console.log(this.error) + } + //this.temp = [...this.extensionField]; + }, (error) => { + console.log(error); + if (error) { + this.error = "No data Available OR server Error"; + } + }); + } + + alertType: string; + alertMessage: string = ""; + alert = [ + { type: "success", message: "Build Successfully" }, + { type: "danger", message: "Some error Happens" }, + ]; + + buildExtension(id, accountID) { + console.log("buildExtension() Account id = " + this.account_id + " Form Code = ", + this.formCode); + if (this.account_id === null && this.formCode === null) { + this.alertType = this.alert[1].type; + this.alertMessage = "form_code is null"; + return; + } + this.extensionService + .buildExtension(id, accountID, this.formCode) + .subscribe( + (data) => { + console.log("build successfully ", data); + this.alert.forEach((e) => { + if (e.type === "success") { + this.alertType = e.type; + this.alertMessage = e.message; + } //data.type === true : e.message ? e.message + + }); + // go to parent entry form... + //this.router.navigate(['../../'], { relativeTo: this.route.parent }); + + if (data) { + this.toastr.success("Build successfully"); + } + + + }, + (err) => { + + if (err) { + this.toastr.error("Build Not Successful"); + } + console.log("build failed ", err); + this.alertType = this.alert[1].type; + this.alertMessage = this.alert[1].message; + } + ); + } + + isChecked(id: number) { + return ( + this.extensionField.find(c => { + if (c.id === id) return c.isActive; + }) !== undefined + ); + } + + chk(checked) { + console.log(checked); + return !checked; + } + + extField: ExtensionField; + checked: boolean; + toggle(id: number) { + console.log(id); + this.extensionService.getById(id).subscribe(ext => { + this.extField = ext; + this.checked = ext.isActive; + console.log('extField ', this.extField); + console.log('checked ', this.checked); + }); + console.log(this.extField.isActive); + //this.extensionService.update(id,this.extField).subscribe(); + } + + goToAdd() { + this.router.navigate(["../add"], { relativeTo: this.route }); + } + goToEdit(id: number) { + this.router.navigate(["../edit/" + id], { relativeTo: this.route }); + } + + goToWhoColumns(id: number) { + this.basic = !this.basic; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.extensionService.delete(id).subscribe((data) => { + console.log(data); + this.ngOnInit(); + if (data.body) { + this.toastr.success('Deleted successfully'); + } + }, (error) => { + console.log('Error in adding data...', +error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + }); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.css b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.css new file mode 100644 index 0000000..08a78e8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.css @@ -0,0 +1,39 @@ +.button1::after { + content: none; +} + +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + background-color: rgb(255, 255, 255); + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +select { + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +.center { + text-align: center; +}/*# sourceMappingURL=editextension.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.css.map new file mode 100644 index 0000000..c952ee2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["editextension.component.scss","editextension.component.css"],"names":[],"mappings":"AAEA;EACE,aAAA;ACDF;;ADGA;EACE,mBAAA;ACAF;;ADGA;EACE,yBAVS;EAWT,YAAA;ACAF;;ADGA;EAEE,aAAA;EACA,eAAA;ACDF;;ADIA;EACE,cAAA;EACA,yBAAA;EACA,sBAAA;EACA,wBAAA;EACA,oCAAA;EACA,eAAA;EACA,WAAA;EACA,mBAAA;ACDF;;ADGA;EACE,WAAA;EACA,gBAAA;EACA,sBAAA;EACA,kBAAA;ACAF;;ADEA;EACE,kBAAA;ACCF","file":"editextension.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.html new file mode 100644 index 0000000..cbb8bda --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.html @@ -0,0 +1,40 @@ +

FORM EXTENSION

+Edit Mode
+
+ + +
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+ +
+
+
diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.scss new file mode 100644 index 0000000..1a7e044 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.scss @@ -0,0 +1,39 @@ +$bg-color: #dddddd; + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: $bg-color; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + background-color:rgb(255, 255, 255); + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +.center { + text-align: center; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.spec.ts new file mode 100644 index 0000000..a8dd592 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditextensionComponent } from './editextension.component'; + +describe('EditextensionComponent', () => { + let component: EditextensionComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ EditextensionComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(EditextensionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.ts new file mode 100644 index 0000000..015a153 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/editextension/editextension.component.ts @@ -0,0 +1,71 @@ +import { HttpErrorResponse } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ExtensionField } from 'src/app/models/fnd/ExtensionField'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; + +interface Rows { + id: number; + firstName: string; + lastName: string; + email: string; + createdAt: Date; + updatedAt: Date; +} +@Component({ + selector: 'app-editextension', + templateUrl: './editextension.component.html', + styleUrls: ['./editextension.component.scss'] +}) +export class EditextensionComponent implements OnInit { + types:string[] = ['header', 'line']; + lookup_values: string[] = []; // come from server + lookups: string[] =[ + 'extn1', 'extn2', 'extn3', 'extn4', 'extn5', + 'extn6', 'extn7', 'extn8', 'extn9', 'extn10', + 'extn11', 'extn12', 'extn13', 'extn14', 'extn15' + ]; + datatype_values: string[] = []; // come from server + datatypes: string[] = ['textfield', 'longtext', 'date', 'checkbox', 'radiobutton', 'autocomplete']; + + + updated = false; + extensionField: ExtensionField; + id: number; + constructor(private router: Router, + private route: ActivatedRoute, + private extensionService: ExtensionService) { } + + ngOnInit(): void { + this.extensionField = new ExtensionField(); + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + this.getById(this.id); + } + getById(id: number) { + this.extensionService.getById(id).subscribe((data) => { + console.log(data); + this.extensionField = data; + }); + } + update() { + this.extensionService.update(this.id, this.extensionField).subscribe( + (data) => { + console.log(data); + this.router.navigate(["../../all"], { relativeTo: this.route, queryParams: { formCode: this.extensionField.form_code }}); + }, + (error: HttpErrorResponse) => { + console.log(error.message); + } + ); + } + + onSubmit() { + this.updated = true; + this.update(); + } + + back() { + this.router.navigate(["../../all"], { relativeTo: this.route, queryParams: { formCode: this.extensionField.form_code } }); + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.css b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.css new file mode 100644 index 0000000..87d9fed --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.css @@ -0,0 +1 @@ +/*# sourceMappingURL=extension.component.css.map */ \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.css.map b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.css.map new file mode 100644 index 0000000..1113c5f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"extension.component.css"} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.html new file mode 100644 index 0000000..6c46b1d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.html @@ -0,0 +1 @@ + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.spec.ts new file mode 100644 index 0000000..56890ae --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ExtensionComponent } from './extension.component'; + +describe('ExtensionComponent', () => { + let component: ExtensionComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ExtensionComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ExtensionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.ts new file mode 100644 index 0000000..483aedf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/extension/extension.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-extension', + templateUrl: './extension.component.html', + styleUrls: ['./extension.component.scss'] +}) +export class ExtensionComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.html new file mode 100644 index 0000000..873f882 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.html @@ -0,0 +1,3 @@ + diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.spec.ts new file mode 100644 index 0000000..39261a3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MainPageComponent } from './main-page.component'; + +describe('MainPageComponent', () => { + let component: MainPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MainPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MainPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.ts new file mode 100644 index 0000000..9873121 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/main-page/main-page.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-main-page', + templateUrl: './main-page.component.html', + styleUrls: ['./main-page.component.scss'] +}) +export class MainPageComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.html b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.html new file mode 100644 index 0000000..ee798b2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.html @@ -0,0 +1,407 @@ + + +
+
+
+
+

{{ 'SEQ_GENERATOR' | translate }}

+

{{ 'FND' | translate }}

+
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
{{ totalSequences }}
+
{{ 'TOTAL_SEQUENCES' | translate }}
+
+
+ + +
+
+
+ + + + + {{ 'LOADING' | translate }} ... + +
{{error}}
+
+ + + + + {{ 'CURRENT_NO' | translate }} + + + + + + + + {{ 'NAME' | translate }} + + + + + + + + {{ 'PREFIX' | translate }} + + + + + + + + {{ 'SEPARATOR' | translate }} + + + + + + + + {{ 'SEQUENCE_SIZE' | translate }} + + + + + + + + {{ 'SUFFIX' | translate }} + + + + + + + + {{ 'STARTING_NO' | translate }} + + + + + + + + {{ 'SEQUENCE_CODE' | translate }} + + + + + + {{user.current_no}} + {{user.sequence_name}} + {{user.prefix}} + {{user.seperator}} + {{user.sequence_size}} + {{user.suffix}} + {{user.starting_no}} + {{user.sequence_code}} + + + + + + + + + + {{ 'RECORDS_PER_PAGE' | translate }} + + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + {{ 'OF' | translate }} {{pagination.totalItems}} {{ 'RECORDS' | translate }} + + +
+ +
+
+
+
+
{{user.sequence_name}}
+
{{user.current_no}}
+
+
+
{{ 'PREFIX' | translate }}{{user.prefix}}
+
{{ 'SEPARATOR' | translate }}{{user.seperator}}
+
{{ 'SEQUENCE_SIZE' | translate }}{{user.sequence_size}}
+
{{ 'SUFFIX' | translate }}{{user.suffix}}
+
{{ 'STARTING_NO' | translate }}{{user.starting_no}}
+
{{ 'SEQUENCE_CODE' | translate }}{{user.sequence_code}}
+
{{ 'DEMONSTRATION' | translate }}{{user.demonstration}}
+
+ +
+
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.scss b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.scss new file mode 100644 index 0000000..6ac473d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.scss @@ -0,0 +1,694 @@ +@import '../../../../../styles/_design-tokens.scss'; + +// Sequence Generator Styles +.sq-hero { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 32px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px; + margin-bottom: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.2); + font-family: var(--theme-font-primary); + + &__content { + display: flex; + align-items: center; + gap: 16px; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 16px; + display: flex; + align-items: center; + justify-content: center; + + clr-icon { + width: 36px; + height: 36px; + color: white; + } + } + + &__title { + font-size: 28px; + font-weight: 700; + margin: 0; + color: white; + font-family: var(--theme-font-secondary); + } + + &__subtitle { + font-size: 16px; + margin: 0; + opacity: 0.9; + color: rgba(255, 255, 255, 0.8); + } + + &__actions { + display: flex; + align-items: center; + gap: 12px; + } +} + +.sq-container { + background: var(--theme-surface); + border-radius: 16px; + padding: 24px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; +} + +// Toolbar, search and stats +.sq-toolbar { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + padding: 16px; + background: var(--theme-surface); + border-radius: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &__left { + flex: 1; + } + + &__right { + display: flex; + align-items: center; + gap: 16px; + } +} + +.sq-search { + position: relative; + max-width: 400px; + + clr-icon { + position: absolute; + left: 12px; + top: 50%; + transform: translateY(-50%); + color: #9ca3af; + z-index: 1; + } + + &__input { + width: 100%; + padding: 12px 12px 12px 40px; + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + font-size: 14px; + transition: all 200ms ease-out; + background: var(--theme-surface); + color: var(--theme-text); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + font-family: var(--theme-font-primary); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); + } + } +} + +.sq-stats { + display: flex; + gap: 16px; +} + +.sq-stat { + min-width: 110px; + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.04); + border-radius: var(--theme-border-radius); + padding: 16px; + text-align: center; + box-shadow: var(--theme-shadow); + + &__value { + font-size: 24px; + font-weight: 700; + color: var(--theme-primary); + margin-bottom: 4px; + } + + &__label { + font-size: 12px; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + } +} + +.sq-view-toggle { + display: flex; + gap: 8px; + + .sq-btn { + min-width: 40px; + } +} + +// Grid columns +.sq-col-title { + display: inline-flex; + align-items: center; + gap: 6px; + color: var(--theme-text-secondary); +} + +.sq-col--prefix .sq-col-title clr-icon, +.sq-col--separator .sq-col-title clr-icon, +.sq-col--size .sq-col-title clr-icon { + color: var(--theme-primary); +} + +// Data Grid Styles +.sq-grid { + background: var(--theme-surface); + border-radius: 16px; + overflow: hidden; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + margin-bottom: 24px; + + ::ng-deep .datagrid { + .datagrid-head { + background: var(--theme-background); + + .datagrid-column { + padding: 16px 24px; + font-size: 12px; + font-weight: 600; + color: var(--theme-text-secondary); + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid #e5e7eb; + } + } + + .datagrid-row { + transition: background-color 150ms ease-out; + + &:hover { + background: var(--theme-background); + } + + &:not(:last-child) { + border-bottom: 1px solid #e5e7eb; + } + + .datagrid-cell { + padding: 16px 24px; + font-size: 14px; + color: var(--theme-text); + } + } + + .datagrid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; + padding: 16px 24px; + } + } +} + +.sq-grid-footer { + background: var(--theme-background); + border-top: 1px solid #e5e7eb; +} + +// Card View Styles +.sq-cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 24px; + margin-bottom: 24px; +} + +.sq-card-item { + background: var(--theme-surface); + border-radius: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + overflow: hidden; + transition: all 200ms ease-out; + + &:hover { + transform: translateY(-4px); + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + } + + &__header { + display: flex; + align-items: center; + padding: 20px; + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + } + + &__icon { + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + padding: 12px; + margin-right: 16px; + + clr-icon { + width: 24px; + height: 24px; + color: white; + } + } + + &__title { + flex: 1; + font-size: 18px; + font-weight: 600; + margin: 0; + } + + &__badge { + background: rgba(255, 255, 255, 0.2); + border-radius: 20px; + padding: 4px 12px; + font-size: 14px; + font-weight: 600; + } + + &__body { + padding: 20px; + } + + &__footer { + display: flex; + gap: 12px; + padding: 0 20px 20px; + } +} + +.sq-kv { + display: flex; + justify-content: space-between; + margin-bottom: 12px; + padding-bottom: 12px; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + + &:last-child { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; + } + + span { + color: var(--theme-text-secondary); + font-size: 14px; + } + + strong { + color: var(--theme-text); + font-weight: 500; + } +} + +// Form Styles +.sq-form { + .clr-row { + margin: 0 -12px; + } + + .clr-col-md-6, + .clr-col-sm-12 { + padding: 0 12px; + margin-bottom: 20px; + } +} + +.sq-form-label { + display: block; + font-size: 14px; + font-weight: 500; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); +} + +.sq-form-input, +.sq-form-select { + width: 100%; + padding: 12px 16px; + font-size: 14px; + line-height: 1.5; + color: var(--theme-text); + background: var(--theme-surface); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 8px; + transition: all 200ms ease-out; + margin-bottom: 0; + font-family: var(--theme-font-primary); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); + } + + &:disabled { + background: var(--theme-background); + color: var(--theme-text-secondary); + cursor: not-allowed; + } + + &.error { + border-color: var(--theme-error, #ef4444); + box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); + } + + &::placeholder { + color: var(--theme-text-secondary); + } +} + +.sq-form-select { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e"); + background-position: right 12px center; + background-repeat: no-repeat; + background-size: 16px 12px; + padding-right: 40px; + appearance: none; +} + +.sq-error-message { + color: var(--theme-error, #ef4444); + font-size: 12px; + margin-top: 6px; + font-weight: 500; +} + +.required-field { + color: var(--theme-error, #ef4444); + margin-left: 4px; +} + +.sq-form-help { + color: var(--theme-text-secondary); + font-size: 12px; + margin-bottom: 16px; + font-family: var(--theme-font-primary); +} + +.sq-form-actions { + display: flex; + gap: 12px; + margin-top: 24px; + padding-top: 24px; + border-top: 1px solid rgba(0, 0, 0, 0.05); +} + +// Modern Button Styles using ThemeService +.sq-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + font-size: 14px; + font-weight: 500; + line-height: 1; + border-radius: 8px; + border: 1px solid transparent; + cursor: pointer; + transition: all 200ms ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + font-family: var(--theme-font-primary); + z-index: 1; + + &:focus { + outline: 2px solid var(--theme-primary); + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + // Sizes + &.sq-btn-sm { + padding: 8px 16px; + font-size: 13px; + height: 32px; + } + + &.sq-btn-md { + padding: 12px 20px; + font-size: 14px; + height: 40px; + } + + &.sq-btn-lg { + padding: 16px 24px; + font-size: 16px; + height: 48px; + } + + // Variants + &.sq-btn-primary { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-color: var(--theme-primary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: linear-gradient(135deg, var(--theme-primary, #0284c7) 0%, var(--theme-accent, #7c3aed) 100%); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + + &:active { + transform: translateY(0); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + } + + &.sq-btn-outline { + background: transparent; + color: var(--theme-secondary); + border-color: var(--theme-secondary); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: rgba(100, 116, 139, 0.1); + border-color: var(--theme-secondary); + color: var(--theme-secondary); + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + } + } + + &.sq-btn-error { + background: var(--theme-error, #ef4444); + color: white; + border-color: var(--theme-error, #ef4444); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + + &:hover { + background: var(--theme-error-dark, #dc2626); + border-color: var(--theme-error-dark, #dc2626); + transform: translateY(-2px); + box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.1); + } + } + + &.sq-btn-ghost { + background: transparent; + color: var(--theme-text-secondary); + border-color: transparent; + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } + } +} + +// Action items in datagrid +.sq-action-item { + @extend .sq-btn; + @extend .sq-btn-ghost; + @extend .sq-btn-sm; + width: 100%; + justify-content: flex-start; + margin-bottom: 4px; + text-align: left; + + clr-icon { + width: 16px; + height: 16px; + margin-right: 8px; + } + + &.sq-btn-error { + color: var(--theme-error, #ef4444); + + &:hover { + background: rgba(239, 68, 68, 0.1); + color: var(--theme-error, #ef4444); + } + } +} + +// Delete Modal Styles +.sq-delete-header { + text-align: center; + padding: 24px; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.sq-delete-icon { + color: var(--theme-error, #ef4444); + margin-bottom: 16px; +} + +.sq-delete-title { + font-size: 24px; + font-weight: 700; + color: var(--theme-text); + margin: 0 0 8px 0; +} + +.sq-delete-subtitle { + font-size: 16px; + color: var(--theme-text-secondary); + margin: 0; +} + +.sq-delete-details { + padding: 24px; +} + +.sq-delete-detail-item { + display: flex; + justify-content: space-between; + padding: 12px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + + &:last-child { + border-bottom: none; + } +} + +.sq-delete-detail-label { + font-weight: 500; + color: var(--theme-text-secondary); +} + +.sq-delete-detail-value { + font-weight: 600; + color: var(--theme-text); +} + +// Modal Styles +.sq-modal-title clr-icon { + margin-right: 6px; + color: var(--theme-primary); +} + +::ng-deep .modal-header { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: white; + border-radius: 16px 16px 0 0 !important; + padding: 20px 24px !important; + + .modal-title { + color: white; + font-weight: 600; + font-size: 20px; + margin: 0; + } + + .close { + color: white; + opacity: 0.8; + + &:hover { + opacity: 1; + } + } +} + +::ng-deep .modal-body { + padding: 24px !important; +} + +::ng-deep .modal-footer { + padding: 20px 24px !important; + background: var(--theme-background); + border-radius: 0 0 16px 16px !important; + border-top: 1px solid rgba(0, 0, 0, 0.05) !important; +} + +// Breadcrumb +.mm-breadcrumb { + color: var(--theme-text-secondary); +} + +// Responsive adjustments +@media (max-width: 768px) { + .sq-hero { + flex-direction: column; + gap: 16px; + text-align: center; + + &__content { + flex-direction: column; + text-align: center; + } + + &__actions { + width: 100%; + justify-content: center; + } + } + + .sq-toolbar { + flex-direction: column; + gap: 16px; + } + + .sq-search { + max-width: 100%; + } + + .sq-stats { + flex-direction: column; + width: 100%; + } + + .sq-cards { + grid-template-columns: 1fr; + } + + .sq-form-actions { + flex-direction: column; + } + + .sq-btn { + width: 100%; + justify-content: center; + } + + .sq-card-item__footer { + flex-direction: column; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.spec.ts new file mode 100644 index 0000000..5981aa5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SequencegenaratorComponent } from './sequencegenarator.component'; + +describe('SequencegenaratorComponent', () => { + let component: SequencegenaratorComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ SequencegenaratorComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(SequencegenaratorComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.ts new file mode 100644 index 0000000..e826e2a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.ts @@ -0,0 +1,216 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { SequenceService } from 'src/app/services/api/sequence.service'; +import { ExcelService } from 'src/app/services/excel.service'; +import * as moment from 'moment'; +import { HttpErrorResponse } from '@angular/common/http'; +import { ThemeService } from 'src/app/services/theme.service'; + +@Component({ + selector: 'app-sequencegenarator', + templateUrl: './sequencegenarator.component.html', + styleUrls: ['./sequencegenarator.component.scss'] +}) +export class SequencegenaratorComponent implements OnInit { + loading = false; + selected: any[] = []; + workflow_data; + rowSelected: any = {}; + modaldelete = false; + error; + alldata = []; + modaladd = false; + modaledit = false; + submitted = false; + filterText = ''; + // Changed default view to cards + viewMode: 'table' | 'cards' = 'cards'; + + public entryForm: FormGroup; + + constructor( + private seqservice: SequenceService, + private router: Router, + private toastr: ToastrService, + private _fb: FormBuilder, + private route: ActivatedRoute, + private excel: ExcelService, + private themeService: ThemeService + ) { } + + ngOnInit(): void { + // Ensure theme variables are applied to the view + this.themeService.currentTheme$.subscribe(() => { + // CSS variables are updated globally; no extra handling needed here + }); + + this.getall(); + this.entryForm = this._fb.group({ + prefix: [null, Validators.required], + sequence_size: [null], + suffix: [null], + starting_no: [null], + seperator: [null], + sequence_name: [null, Validators.required], + sequence_code: [null], + demonstration: [null], + current_no: [null] + }); + } + + // Stats & filtering helpers for UI only + get totalSequences(): number { + return ((this.alldata as unknown as any[]) || []).length; + } + + get filteredSequences(): any[] { + const items: any[] = (this.alldata as unknown as any[]) || []; + const text = (this.filterText || '').toLowerCase(); + if (!text) { return items; } + + // Search across all relevant fields + return items.filter(s => ( + (s?.sequence_name || '').toLowerCase().includes(text) || + (s?.prefix || '').toLowerCase().includes(text) || + (s?.sequence_code || '').toLowerCase().includes(text) || + (s?.suffix || '').toLowerCase().includes(text) || + (s?.seperator || '').toLowerCase().includes(text) || + (s?.sequence_size?.toString() || '').includes(text) || + (s?.starting_no?.toString() || '').includes(text) || + (s?.current_no?.toString() || '').includes(text) || + (s?.demonstration || '').toLowerCase().includes(text) + )); + } + + setViewMode(mode: 'table' | 'cards') { + this.viewMode = mode; + } + + getall() { + this.seqservice.getAll().subscribe((data) => { + console.log(data); + this.alldata = data; + + if (this.alldata.length == 0) { + console.log('zero data '); + this.error = "No data Available!" + } + }, (error) => { + console.log(error); + if (error) { + this.error = "No data Available OR server Error"; + } + }) + } + + onSubmit() { + console.log(this.entryForm.value); + this.submitted = true + if (this.entryForm.invalid) { + return + } + this.onCreate(); + } + + onCreate() { + this.modaladd = false; + this.seqservice.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Succesfully"); + this.ngOnInit(); + } + }, (error) => { + if (error.status >= 200 && error.status <= 299) { + this.toastr.success("Added Succesfully"); + this.ngOnInit(); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + this.ngOnInit(); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + this.ngOnInit(); + } + }); + } + + goToAdd() { + this.modaladd = true; + this.submitted = false; + // Reset form + this.entryForm.reset(); + } + + onExport() { + this.excel.exportAsExcelFile(this.alldata, 'sequence_', + moment().format('YYYYMMDD_HHmmss')) + } + + goToEdit(row) { + this.rowSelected = { ...row }; // Create a copy to avoid direct binding issues + console.log(row) + this.modaledit = true; + } + + onDelete(row) { + this.rowSelected = row; + this.modaldelete = true; + } + + delete(id) { + this.modaldelete = false; + console.log("in delete " + id); + this.seqservice.delete(id).subscribe((data) => { + console.log(data); + if (data == null || data.status >= 200 && data.status <= 299) { + this.toastr.success('Deleted successfully'); + this.ngOnInit(); + } + }, + (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + this.toastr.success('Deleted successfully'); + this.ngOnInit(); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error('Not Deleted Data Getting Some Error'); + this.ngOnInit(); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error('Server Error'); + this.ngOnInit(); + } + }); + } + + onUpdate(id) { + this.modaledit = false; + this.seqservice.update(id, this.rowSelected).subscribe((data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Succesfully"); + this.ngOnInit(); + } + }, (error: HttpErrorResponse) => { + console.log(error?.message); + if (error.status >= 200 && error.status <= 299) { + this.toastr.success("Update Succesfully"); + this.ngOnInit(); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Update"); + this.ngOnInit(); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + this.ngOnInit(); + } + }); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.html b/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.html new file mode 100644 index 0000000..1246ebd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.html @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.scss b/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.scss new file mode 100644 index 0000000..3afe935 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.scss @@ -0,0 +1,785 @@ +// ======================================== +// MODERN LAYOUT COMPONENT STYLES +// ======================================== + +@import '../../../../styles/design-tokens'; + +// Legacy form styles (preserved for compatibility) +input[type=text],[type=date], select,textarea { + width: 100%; + padding: 12px 20px; + margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +// Modern Layout Styles +// ======================================== + +.modern-layout { + background: linear-gradient(135deg, $gray-50 0%, $gray-100 100%); + min-height: 100vh; +} + +// Header Styles +// ======================================== + +.modern-header { + background: linear-gradient(135deg, $primary-600 0%, $primary-700 100%); + backdrop-filter: $backdrop-blur-md; + border-bottom: 1px solid rgba(255, 255, 255, 0.1); + box-shadow: $shadow-lg; + position: sticky; + top: 0; + z-index: $z-sticky; + height: $header-height; + padding: 0 $space-6; +} + +.modern-branding { + display: flex; + align-items: center; + gap: $space-4; + + .modern-nav-link { + display: flex; + align-items: center; + gap: $space-4; + text-decoration: none; + color: inherit; + transition: all $duration-200 $ease-out; + + &:hover { + transform: translateY(-1px); + } + } + + .logo-container { + position: relative; + display: flex; + align-items: center; + } + + .logo-wrapper { + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 48px; + height: 48px; + background: $gradient-primary; + border-radius: $radius-xl; + box-shadow: $shadow-md; + transition: all $duration-300 $ease-out; + + &:hover { + transform: scale(1.05); + box-shadow: $shadow-lg; + } + + .logo-img { + width: 32px; + height: 32px; + object-fit: contain; + filter: brightness(0) invert(1); + } + + .logo-glow { + position: absolute; + top: -2px; + left: -2px; + right: -2px; + bottom: -2px; + background: $gradient-primary; + border-radius: $radius-xl; + opacity: 0; + filter: blur(8px); + transition: opacity $duration-300 $ease-out; + } + + &:hover .logo-glow { + opacity: 0.3; + } + } + + .brand-text { + display: flex; + flex-direction: column; + gap: 2px; + + .company-title { + font-size: $text-xl; + font-weight: $font-bold; + color: $white; + line-height: 1.2; + } + + .company-subtitle { + font-size: $text-xs; + font-weight: $font-medium; + color: rgba(255, 255, 255, 0.8); + text-transform: uppercase; + letter-spacing: 0.05em; + } + } +} + +// Header Navigation +// ======================================== + +.modern-header-nav { + display: flex; + align-items: center; + gap: $space-2; + margin-left: $space-8; + + .modern-nav-icon { + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 48px; + height: 48px; + border-radius: $radius-lg; + background: transparent; + color: rgba(255, 255, 255, 0.8); + text-decoration: none; + transition: all $duration-200 $ease-out; + + &:hover { + background: rgba(255, 255, 255, 0.1); + color: $white; + transform: translateY(-1px); + } + + &.active { + background: rgba(255, 255, 255, 0.2); + color: $white; + box-shadow: $shadow-md; + } + + .nav-icon-wrapper { + position: relative; + display: flex; + align-items: center; + justify-content: center; + } + + .nav-tooltip { + position: absolute; + top: -40px; + left: 50%; + transform: translateX(-50%); + background: $gray-900; + color: $white; + padding: $space-2 $space-3; + border-radius: $radius-md; + font-size: $text-xs; + font-weight: $font-medium; + white-space: nowrap; + opacity: 0; + visibility: hidden; + transition: all $duration-200 $ease-out; + z-index: $z-tooltip; + + &::after { + content: ''; + position: absolute; + top: 100%; + left: 50%; + transform: translateX(-50%); + border: 4px solid transparent; + border-top-color: $gray-900; + } + } + + &:hover .nav-tooltip { + opacity: 1; + visibility: visible; + } + } +} + +// Header Actions +// ======================================== + +.modern-header-actions { + display: flex; + align-items: center; + gap: $space-4; + margin-left: auto; +} + +.modern-user-dropdown { + .modern-user-button { + display: flex; + align-items: center; + gap: $space-3; + padding: $space-2 $space-4; + background: rgba(255, 255, 255, 0.1); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: $radius-xl; + color: $white; + text-decoration: none; + transition: all $duration-200 $ease-out; + cursor: pointer; + + &:hover { + background: rgba(255, 255, 255, 0.2); + border-color: rgba(255, 255, 255, 0.3); + transform: translateY(-1px); + box-shadow: $shadow-md; + } + + .user-avatar { + position: relative; + display: flex; + align-items: center; + justify-content: center; + } + + .avatar-circle { + width: 36px; + height: 36px; + background: rgba(255, 255, 255, 0.2); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: $white; + font-size: $text-sm; + font-weight: $font-semibold; + } + + .user-status-indicator { + position: absolute; + bottom: 0; + right: 0; + width: 12px; + height: 12px; + background: $accent-green; + border: 2px solid $white; + border-radius: 50%; + } + + .user-info { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 2px; + + .user-name { + font-size: $text-sm; + font-weight: $font-semibold; + color: $white; + line-height: 1.2; + } + + .user-role { + font-size: $text-xs; + color: rgba(255, 255, 255, 0.8); + text-transform: uppercase; + letter-spacing: 0.05em; + } + } + + .dropdown-arrow { + font-size: $text-xs; + color: rgba(255, 255, 255, 0.8); + transition: transform $duration-200 $ease-out; + } + + &:hover .dropdown-arrow { + transform: rotate(180deg); + } + } +} + +// Dropdown Menu +// ======================================== + +.modern-dropdown-menu { + background: $white; + border: 1px solid $gray-200; + border-radius: $radius-xl; + box-shadow: $shadow-xl; + padding: $space-2; + min-width: 280px; + margin-top: $space-2; + + .dropdown-header { + padding: $space-4; + border-bottom: 1px solid $gray-200; + margin-bottom: $space-2; + + .user-profile { + display: flex; + align-items: center; + gap: $space-3; + + .profile-avatar { + width: 48px; + height: 48px; + background: $gradient-primary; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: $white; + font-size: $text-lg; + font-weight: $font-semibold; + } + + .profile-info { + display: flex; + flex-direction: column; + gap: 2px; + + .profile-name { + font-size: $text-sm; + font-weight: $font-semibold; + color: $gray-900; + } + + .profile-email { + font-size: $text-xs; + color: $gray-500; + } + } + } + } + + .dropdown-divider { + height: 1px; + background: $gray-200; + margin: $space-2 0; + } + + .modern-dropdown-item { + display: flex; + align-items: center; + gap: $space-3; + padding: $space-3 $space-4; + border-radius: $radius-lg; + color: $gray-700; + text-decoration: none; + font-size: $text-sm; + font-weight: $font-medium; + transition: all $duration-200 $ease-out; + + &:hover { + background: $gray-50; + color: $gray-900; + transform: translateX(4px); + } + + &.logout-item { + color: $accent-red; + + &:hover { + background: rgba($accent-red, 0.1); + color: $accent-red; + } + } + + clr-icon { + font-size: $text-base; + width: 20px; + height: 20px; + } + } +} + +// Language Dropdown +// ======================================== + +.modern-language-dropdown { + .modern-language-button { + display: flex; + align-items: center; + gap: $space-3; + padding: $space-3 $space-4; + width: 100%; + background: transparent; + border: none; + color: $gray-700; + text-decoration: none; + font-size: $text-sm; + font-weight: $font-medium; + border-radius: $radius-lg; + transition: all $duration-200 $ease-out; + cursor: pointer; + + &:hover { + background: $gray-50; + color: $gray-900; + } + + .language-icon { + font-size: $text-base; + color: $primary-600; + } + + .dropdown-arrow { + margin-left: auto; + font-size: $text-xs; + color: $gray-400; + transition: transform $duration-200 $ease-out; + } + + &:hover .dropdown-arrow { + transform: rotate(180deg); + } + } + + .modern-language-menu { + background: $white; + border: 1px solid $gray-200; + border-radius: $radius-xl; + box-shadow: $shadow-lg; + padding: $space-2; + min-width: 200px; + margin-left: $space-2; + + .modern-lang-item { + display: flex; + align-items: center; + gap: $space-3; + padding: $space-3 $space-4; + border-radius: $radius-lg; + color: $gray-700; + text-decoration: none; + font-size: $text-sm; + font-weight: $font-medium; + transition: all $duration-200 $ease-out; + + &:hover { + background: $primary-50; + color: $primary-700; + transform: translateX(4px); + } + + .lang-icon { + font-size: $text-base; + color: $primary-600; + } + + .lang-flag { + margin-left: auto; + font-size: $text-lg; + } + } + } +} + +// Content Container +// ======================================== + +.modern-content-container { + display: flex; + min-height: calc(100vh - #{$header-height}); + background: transparent; +} + +.modern-content-area { + flex: 1; + background: transparent; + padding: 0; + overflow-x: hidden; + + .content-wrapper { + padding: $space-6; + min-height: calc(100vh - #{$header-height}); + } +} + +// Sidebar Styles +// ======================================== + +.modern-sidebar { + background: rgba(255, 255, 255, 0.98); + backdrop-filter: $backdrop-blur-md; + border-right: 1px solid rgba(0, 0, 0, 0.05); + box-shadow: $shadow-lg; + width: $sidebar-width; + transition: all $duration-300 $ease-out; + + &.nav-collapsed { + width: $sidebar-width-collapsed; + } + + .sidebar-content { + padding: $space-4 0; + } + + .menu-item-wrapper { + margin-bottom: $space-2; + } +} + +// Navigation Groups +// ======================================== + +.modern-nav-group { + margin-bottom: $space-2; + + .nav-group-header { + display: flex; + align-items: center; + gap: $space-3; + padding: $space-3 $space-4; + color: $gray-700; + font-size: $text-sm; + font-weight: $font-semibold; + cursor: pointer; + border-radius: $radius-lg; + margin: 0 $space-2; + transition: all $duration-200 $ease-out; + + &:hover { + background: $gray-50; + color: $gray-900; + } + + .nav-group-icon { + font-size: $text-lg; + color: $primary-600; + } + + .nav-group-title { + flex: 1; + } + + .nav-group-arrow { + font-size: $text-sm; + color: $gray-400; + transition: transform $duration-200 $ease-out; + + &.rotated { + transform: rotate(90deg); + } + } + } + + .modern-nav-children { + margin-top: $space-1; + padding-left: $space-4; + } +} + +// Navigation Links +// ======================================== + +.modern-nav-link, +.modern-nav-link-single { + display: flex; + align-items: center; + gap: $space-3; + padding: $space-3 $space-4; + color: $gray-600; + text-decoration: none; + font-size: $text-sm; + font-weight: $font-medium; + border-radius: $radius-lg; + margin: 0 $space-2; + transition: all $duration-200 $ease-out; + position: relative; + + &:hover { + background: $primary-50; + color: $primary-700; + transform: translateX(4px); + } + + &.active { + background: $primary-100; + color: $primary-800; + font-weight: $font-semibold; + + &::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + width: 3px; + height: 20px; + background: $primary-600; + border-radius: 0 $radius-sm $radius-sm 0; + } + } + + .nav-link-icon { + font-size: $text-base; + color: $gray-500; + width: 20px; + height: 20px; + display: flex; + align-items: center; + justify-content: center; + } + + .nav-link-text { + flex: 1; + } + + &:hover .nav-link-icon { + color: $primary-600; + } + + &.active .nav-link-icon { + color: $primary-700; + } +} + +// Responsive Design +// ======================================== + +@media (max-width: $breakpoint-lg) { + .modern-header { + padding: 0 $space-4; + } + + .modern-header-nav { + margin-left: $space-4; + gap: $space-1; + + .modern-nav-icon { + width: 40px; + height: 40px; + } + } + + .modern-content-area .content-wrapper { + padding: $space-4; + } + + .modern-sidebar { + width: $sidebar-width-collapsed; + + .nav-group-title, + .nav-link-text { + display: none; + } + + .modern-nav-link, + .modern-nav-link-single { + justify-content: center; + padding: $space-3; + } + } +} + +@media (max-width: $breakpoint-md) { + .modern-branding .brand-text { + display: none; + } + + .modern-user-button .user-info { + display: none; + } + + .modern-header-nav { + display: none; + } +} + +// Legacy styles (preserved for compatibility) +// ======================================== + +.center-content { + //width: 100%; + // max-width: 800px; + margin: auto; + // padding: 0 15px; + // display: flex; + // flex-direction: row; + // align-items: center; + // justify-content: center; + // flex-wrap: wrap; + // text-align: center; +} +/* Adjust the language button to be white and center its content vertically */ +.lang-btn { + padding: 12px 15px; + background-color: #007bff; /* Blue background */ + color: white; /* White text color */ + border: none; + border-radius: 5px; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 16px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; +} + +.lang-btn:hover { + background-color: #0056b3; /* Darker blue on hover */ +} + +.lang-btn .language-icon, +.lang-btn .caret-icon { + color: white; /* White color for icons */ +} + +/* Make sure the label inside the button is also white */ +.lang-btn .language-label { + color: white; /* White color for the text */ + margin-right: 8px; +} + +/* Center the dropdown menu */ +.lang-dropdown-menu { + background-color: #f8f9fa; + border-radius: 5px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + max-width: 200px; + font-size: 14px; +} + +/* Style for each item in the dropdown */ +.lang-item { + padding: 10px; + display: flex; + align-items: center; + color: #333; /* Default text color for dropdown items */ + text-decoration: none; + transition: background-color 0.3s ease; +} + +.lang-item:hover { + background-color: #016692; /* Blue on hover */ + color: white; /* White text on hover */ +} + +/* Icon style inside each dropdown item */ +.lang-icon { + margin-right: 10px; + color: #007bff; /* Blue color for icons in dropdown */ +} + +/* Change text and icon to white when the dropdown is active */ +.lang-item .lang-icon { + color: white; +} + +/* Add some padding for top center positioning */ +.clr-dropdown button { + padding-top: 10px; /* Adjust top padding as needed */ + padding-bottom: 10px; /* Ensure button is evenly spaced */ +} + +/* Optional: Add a separator between the dropdown items */ +.lang-item:not(:last-child) { + border-bottom: 1px solid #ddd; +} + +/* Ensure proper alignment of the dropdown icon and label */ +.clr-dropdown button .language-label, +.clr-dropdown button .language-icon { + display: inline-block; + vertical-align: middle; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.spec.ts new file mode 100644 index 0000000..c4d6365 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LayoutComponent } from './layout.component'; + +describe('LayoutComponent', () => { + let component: LayoutComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LayoutComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LayoutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.ts b/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.ts new file mode 100644 index 0000000..4619158 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/layout/layout.component.ts @@ -0,0 +1,311 @@ + +import { Component, ViewEncapsulation, OnInit, Input } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { LoginService } from '../../../services/api/login.service'; +import { UserInfoService } from '../../../services/user-info.service'; +import { RealnetMenuService } from '../../../services/api/realnet-menu.service'; +import { Rn_Main_Menu } from '../../../models/builder/Rn_Main_Menu'; +import { MenuGroupService } from '../../../services/admin/menu-group.service'; +// import { GuidedTour, Orientation} from '../ngx-guided-tour/src/lib/guided-tour.constants'; +// import { GuidedTourService } from '../ngx-guided-tour/src/lib/guided-tour.service'; +// import { TourService } from '../ngx-guided-tour/src/lib/tour.service'; +import { ToastrService } from 'ngx-toastr'; +import { environment } from 'src/environments/environment'; +import { SysparameterService } from 'src/app/services/admin/sysparameter.service'; +import { ReportBuilderService } from 'src/app/services/api/report-builder.service'; +import { map } from 'rxjs'; + +import { RouterModule } from '@angular/router'; +import { ProjectSetup } from 'src/app/models/builder/Project_setup'; +import { Dashboard3Service } from 'src/app/services/builder/dashboard3.service'; + +import { TranslateService } from '@ngx-translate/core'; +import { ThemeService } from 'src/app/services/theme.service'; + +@Component({ + selector: 'app-layout', + templateUrl: './layout.component.html', + styleUrls: ['./layout.component.scss'] +}) +export class LayoutComponent implements OnInit { + // baseUrl= environment.chaturl; + @Input() data: any; + + loading = false; + apps: Array = []; + projectsetup; + + collapsed = true; + public showAppAlert: boolean = false; + modalteam = false; + public userName: string = ""; + + private formCode: string = 'teacher_form'; + public key: string = "formCode"; + public storage: Storage = sessionStorage; + + constructor( + private router: Router, + private route: ActivatedRoute, + private userInfoService: UserInfoService, + private realnetMenuService: RealnetMenuService, + private menuGroupService: MenuGroupService, + private sysparaservice: SysparameterService, + private reportBuilderService: ReportBuilderService, + private dashboardService: Dashboard3Service, + private translate: TranslateService, + private themeService: ThemeService, + // private guidedTourService: GuidedTourService, + // private tourservice: TourService, + private toastr: ToastrService, + ) { + this.translate.setDefaultLang('en'); + this.userName = this.userInfoService.getUserName(); + this.reportBuilderService.getrbDetails().subscribe((data) => { + this.gridData = data; + }); + } + + + + switchLanguage(language: string): void { + this.translate.use(language); // Switch to the selected language + } + user_name: any; + userrole: any; + menus: Rn_Main_Menu[]; + menu: any; + tourdata; + steps; + error; + ngOnInit() { + this.storage.setItem(this.key, this.formCode); + this.user_name = this.userInfoService.getUserName(); + console.log('user name: ' + this.user_name); + this.userrole = this.userInfoService.getRoles(); + console.log('user_role', this.userrole); + this.udata = this.userInfoService.getUserId(); + console.log('user id', this.udata); + this.loadMenuByAccountId(); + this.loadMenuByMenuGroup(); + this.getById(1); + // this.tourservice.getall().subscribe((data)=>{ + // this.tourdata=data[1]; + // //console.log("tour data",data); + // console.log(this.tourdata); + // //console.log(this.tourdata.tourId); + // //console.log(this.tourdata.useOrb); + // //this.steps=JSON.stringify(this.tourdata.steps); + // // console.log(this.tourdata.steps); + // //this.dashboardTour.tourId=this.tourdata.tourId; + // //console.log(this.dashboardTour.tourId); + // //this.dashboardTour.useOrb=this.tourdata.useOrb; + // // this.dashboardTour.steps=this.tourdata.steps; + // }); + } + + + + + showFolderNames: boolean = false; // Variable to control the report names display + reportNames: any[] = []; // Store the report names + + // getName() { + // this.reportBuilderService.getrbDetails().pipe( + // map((data) => data.map((item) => item.folderName)) + // ).subscribe((reportName) => { + // this.reportNames = reportName; + // // this.showReportNames = true; // Toggle on + // console.log('Report Names:', this.reportNames); + // }); + + // } + + + getName() { + if (this.showFolderNames) { + // If in report mode, switch to default mode + this.showFolderNames = false; + } else { + // If in default mode, switch to report mode + this.reportBuilderService.getrbDetails().pipe( + map((data) => data.map((item) => item.folderName)) + ).subscribe( + (folderName) => { + this.reportNames = folderName; + console.log('Report Names:', this.reportNames); + this.showFolderNames = true; + },); + } + } + + filteredGridData: any[] = []; + gridData: any[] = []; + // Function to filter the data based on the selected folder + filterGridDataByFolder(folderName: string) { + this.filteredGridData = this.gridData.filter(item => item.folderName === folderName); + } + + showDashNames: boolean = false; + dashNames: any[] = []; + getDashName() { + if (this.showDashNames) { + // If in report mode, switch to default mode + this.showDashNames = false; + } else { + // If in default mode, switch to report mode + this.dashboardService.getAllDash().pipe( + map((data) => data.map((item) => item.dashboard_name)) + ).subscribe( + (dashboard_name) => { + this.dashNames = dashboard_name; + console.log('Dashboard Names:', this.dashNames); + // this.showFolderNames = true; + this.showDashNames = true; + },); + } + } + + + + + + + + showSetupMenus: boolean = false; + toggleSetupMenus() { + this.showSetupMenus = !this.showSetupMenus; + + } + + + + + + + + + // side nav menu-sub_menu + loadMenuByAccountId() { + this.realnetMenuService.getByAccountId().subscribe(resp => { + this.menus = resp; + console.log('menu: ', this.menus); + }); + } + + loadMenuByMenuGroup() { + this.menuGroupService.getByCurrentUserMenuGroupId2().subscribe(resp => { + this.menus = resp; + console.log('menus: ', this.menus); + }, (error) => { + console.log(error); + if (error) { + this.error = "No data Available OR server Error"; + } + if (error.status === 401) { + // auto logout if 401 response returned from api + // this.authenticationService.logout(); + this.toastr.error("Your Token Is Expire Plz login Again") + //location.reload(true); + } + }) + } + sysparameter; + getById(id: number) { + this.sysparaservice.getById(id).subscribe((data) => { + this.sysparameter = data; + console.log("getbyiddata", this.sysparameter); + }, + (err) => { + console.log(err); + } + ); + } + + + /* menuGroup: Rn_Menu_Group_Header[]; + menu_id: number; + loadMenuGroupData() { + this.menuGroupService.getAll().subscribe(resp => { + this.menuGroup = resp; + this.menu_id = this.menuGroup + }); + } */ + + + + + + navbarSelectionChange(val) { + // console.log(val); + } + + closeAppAlert() { + this.showAppAlert = false; + } + + isDisabled(input: string): boolean { + if (input === null) { + return true; + } else false; + } + + + onLogout() { + this.userInfoService.logout().subscribe((data) => { + console.log(data); + }); + sessionStorage.clear(); + this.router.navigate(['login']); + } + menuFlag = true; + menuFlag1 = false; + udata; + uid; + message() { + //this.menuFlag = false; + // this.menuFlag1 = true; + // this.menuGroupService.getuser(this.udata).subscribe((data)=>{ + // console.log(data); + // }) + // window.open(`${this.baseUrl}`) + //window.location.href = `${this.baseUrl}`; + //this.udata=this.userInfoService.getUserInfo(); + //console.log(this.udata); + + this.menuGroupService.save(this.udata); + + this.uid = this.udata.userid; + localStorage.setItem("id", JSON.stringify(this.udata)); + //localStorage.setItem('id', this.uid); + //window.location.href = (`${this.baseUrl}/` + this.udata), true + //this.router.navigate([`${this.baseUrl}`], { relativeTo: this.route ,queryParams: { id: this.udata }}); + + //this.router.navigate(["../sureboard"],{relativeTo: this.route, queryParams: { userid: this.udata }}); + //this.router.navigate([`${this.baseUrl}`],{relativeTo: this.route, queryParams: { userid: this.udata }}); + //this.udata = this.userInfoService.getUserInfo(); + //this.userInfoService.storeUserInfo(JSON.stringify(this.udata.user)); + }// + + modaladd() { + //this.modalteam=true; + this.router.navigate(['/cns-portal/myworkspace']); + } + mc; + me; + md; + mv; + send(val) { + console.log(val); + this.menuGroupService.storeaddeditvalues(val); + this.mc = val.mcreate; + this.me = val.medit; + this.md = val.mdelete; + this.mv = val.mvisible; + if (this.mv == 'false') { + this.router.navigate(['/**']) + } + this.router.navigate(['./' + val.main_menu_action_name], { relativeTo: this.route }); + } + //skipLocationChange: true, value pass params->,queryParams:{mc:this.mc,me:this.me,md:this.md} +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.html b/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.html new file mode 100644 index 0000000..b97a6cc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.html @@ -0,0 +1,240 @@ + +
+ +
+
+
+

+ Welcome to CloudnSure + Enterprise Platform +

+

+ Your comprehensive solution for data management, reporting, and business intelligence +

+
+ + + +
+
+
+
+
+ + Analytics +
+
+ + Reports +
+
+ + Settings +
+
+
+
+
+ + +
+
+
+
+
+ +
+
+ + +12% +
+
+
+
1,234
+
Active Users
+
+
+ +
+
+
+ +
+
+ + +8% +
+
+
+
567
+
Reports Generated
+
+
+ +
+
+
+ +
+
+ + -3% +
+
+
+
2.4s
+
Avg Response Time
+
+
+ +
+
+
+ +
+
+ + 99.9% +
+
+
+
99.9%
+
Uptime
+
+
+
+
+ + + + + +
+

Recent Activity

+
+
+
+
+ +
+
+
Report generated successfully
+
2 minutes ago
+
+
+ +
+
+ +
+
+
New user registered
+
15 minutes ago
+
+
+ +
+
+ +
+
+
System maintenance scheduled
+
1 hour ago
+
+
+ +
+
+ +
+
+
Data import completed
+
2 hours ago
+
+
+
+
+
+
+ + + diff --git a/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.scss b/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.scss new file mode 100644 index 0000000..2bf0fc5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.scss @@ -0,0 +1,510 @@ +// ======================================== +// MODERN DASHBOARD COMPONENT STYLES +// ======================================== + + +@import '../../../../styles/design-tokens'; + + +// Dashboard Container +// ======================================== + +.modern-dashboard { + max-width: 1400px; + margin: 0 auto; + padding: 0; +} + +// Welcome Section +// ======================================== + +.welcome-section { + background: linear-gradient(135deg, $primary-500 0%, $primary-700 100%); + border-radius: $radius-2xl; + margin-bottom: $space-8; + overflow: hidden; + position: relative; + + &::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: url('data:image/svg+xml,'); + opacity: 0.3; + } + + .welcome-content { + display: flex; + align-items: center; + justify-content: space-between; + padding: $space-12 $space-8; + position: relative; + z-index: 1; + + @media (max-width: $breakpoint-lg) { + flex-direction: column; + text-align: center; + gap: $space-8; + } + } + + .welcome-text { + flex: 1; + max-width: 600px; + + .welcome-title { + font-size: $text-5xl; + font-weight: $font-bold; + color: $white; + margin-bottom: $space-4; + line-height: 1.1; + + @media (max-width: $breakpoint-md) { + font-size: $text-4xl; + } + + .title-accent { + display: block; + font-size: $text-2xl; + font-weight: $font-medium; + color: rgba(255, 255, 255, 0.8); + margin-top: $space-2; + + @media (max-width: $breakpoint-md) { + font-size: $text-xl; + } + } + } + + .welcome-subtitle { + font-size: $text-xl; + color: rgba(255, 255, 255, 0.9); + margin-bottom: $space-8; + line-height: 1.6; + + @media (max-width: $breakpoint-md) { + font-size: $text-lg; + } + } + + .welcome-actions { + display: flex; + gap: $space-4; + flex-wrap: wrap; + + @media (max-width: $breakpoint-sm) { + flex-direction: column; + align-items: stretch; + } + } + } + + .welcome-visual { + flex: 0 0 300px; + position: relative; + + @media (max-width: $breakpoint-lg) { + flex: none; + width: 100%; + max-width: 400px; + } + + .visual-container { + position: relative; + width: 100%; + height: 200px; + + .floating-card { + position: absolute; + background: rgba(255, 255, 255, 0.15); + backdrop-filter: $backdrop-blur-md; + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: $radius-xl; + padding: $space-4; + display: flex; + flex-direction: column; + align-items: center; + gap: $space-2; + color: $white; + font-size: $text-sm; + font-weight: $font-medium; + animation: float 3s ease-in-out infinite; + + clr-icon { + font-size: $text-2xl; + } + + &.card-1 { + top: 20px; + left: 20px; + animation-delay: 0s; + } + + &.card-2 { + top: 60px; + right: 40px; + animation-delay: 1s; + } + + &.card-3 { + bottom: 20px; + left: 60px; + animation-delay: 2s; + } + } + } + } +} + +// Stats Section +// ======================================== + +.stats-section { + margin-bottom: $space-8; + + .stats-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: $space-6; + + @media (max-width: $breakpoint-sm) { + grid-template-columns: 1fr; + gap: $space-4; + } + } + + .stats-card { + padding: $space-6; + position: relative; + overflow: hidden; + + &::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 4px; + background: $gradient-primary; + } + + .card-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: $space-4; + + .stats-icon { + width: 48px; + height: 48px; + border-radius: $radius-xl; + display: flex; + align-items: center; + justify-content: center; + font-size: $text-xl; + + &.primary { + background: rgba($primary-500, 0.1); + color: $primary-600; + } + + &.success { + background: rgba($accent-green, 0.1); + color: $accent-green; + } + + &.warning { + background: rgba($accent-orange, 0.1); + color: $accent-orange; + } + + &.info { + background: rgba($primary-500, 0.1); + color: $primary-600; + } + } + + .stats-trend { + display: flex; + align-items: center; + gap: $space-1; + font-size: $text-sm; + font-weight: $font-semibold; + + &.positive { + color: $accent-green; + } + + &.negative { + color: $accent-red; + } + + clr-icon { + font-size: $text-sm; + } + } + } + + .card-body { + .stats-value { + font-size: $text-3xl; + font-weight: $font-bold; + color: $gray-900; + margin-bottom: $space-1; + line-height: 1; + } + + .stats-label { + font-size: $text-sm; + color: $gray-600; + font-weight: $font-medium; + } + } + } +} + +// Actions Section +// ======================================== + +.actions-section { + margin-bottom: $space-8; + + .section-title { + font-size: $text-2xl; + font-weight: $font-bold; + color: $gray-900; + margin-bottom: $space-6; + text-align: center; + } + + .actions-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: $space-6; + + @media (max-width: $breakpoint-sm) { + grid-template-columns: 1fr; + gap: $space-4; + } + } + + .action-card { + display: flex; + align-items: center; + gap: $space-4; + padding: $space-6; + text-decoration: none; + color: inherit; + border: 1px solid $gray-200; + transition: all $duration-300 $ease-out; + + &:hover { + border-color: $primary-300; + transform: translateY(-2px); + box-shadow: $shadow-xl; + } + + .action-icon { + width: 56px; + height: 56px; + background: $gradient-primary; + border-radius: $radius-xl; + display: flex; + align-items: center; + justify-content: center; + color: $white; + font-size: $text-xl; + flex-shrink: 0; + } + + .action-content { + flex: 1; + + h3 { + font-size: $text-lg; + font-weight: $font-semibold; + color: $gray-900; + margin-bottom: $space-1; + } + + p { + font-size: $text-sm; + color: $gray-600; + margin: 0; + line-height: 1.5; + } + } + + .action-arrow { + color: $gray-400; + font-size: $text-lg; + transition: transform $duration-200 $ease-out; + } + + &:hover .action-arrow { + transform: translateX(4px); + } + } +} + +// Activity Section +// ======================================== + +.activity-section { + .section-title { + font-size: $text-2xl; + font-weight: $font-bold; + color: $gray-900; + margin-bottom: $space-6; + text-align: center; + } + + .activity-card { + padding: 0; + overflow: hidden; + + .activity-list { + .activity-item { + display: flex; + align-items: center; + gap: $space-4; + padding: $space-4 $space-6; + border-bottom: 1px solid $gray-100; + transition: background-color $duration-200 $ease-out; + + &:last-child { + border-bottom: none; + } + + &:hover { + background: $gray-50; + } + + .activity-icon { + width: 40px; + height: 40px; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: $text-base; + flex-shrink: 0; + + &.success { + background: rgba($accent-green, 0.1); + color: $accent-green; + } + + &.info { + background: rgba($primary-500, 0.1); + color: $primary-600; + } + + &.warning { + background: rgba($accent-orange, 0.1); + color: $accent-orange; + } + + &.primary { + background: rgba($primary-500, 0.1); + color: $primary-600; + } + } + + .activity-content { + flex: 1; + + .activity-title { + font-size: $text-sm; + font-weight: $font-medium; + color: $gray-900; + margin-bottom: 2px; + } + + .activity-time { + font-size: $text-xs; + color: $gray-500; + } + } + } + } + } +} + +// Responsive Design +// ======================================== + +@media (max-width: $breakpoint-lg) { + .welcome-section .welcome-content { + padding: $space-8 $space-6; + } + + .stats-section .stats-grid { + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + } + + .actions-section .actions-grid { + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + } +} + +@media (max-width: $breakpoint-md) { + .welcome-section .welcome-content { + padding: $space-6 $space-4; + } + + .welcome-text .welcome-title { + font-size: $text-3xl; + } + + .welcome-text .welcome-subtitle { + font-size: $text-base; + } + + .stats-section .stats-grid { + grid-template-columns: 1fr; + } + + .actions-section .actions-grid { + grid-template-columns: 1fr; + } +} + +@media (max-width: $breakpoint-sm) { + .modern-dashboard { + padding: 0 $space-4; + } + + .welcome-section { + margin-bottom: $space-6; + } + + .stats-section, + .actions-section, + .activity-section { + margin-bottom: $space-6; + } + + .welcome-actions { + flex-direction: column; + align-items: stretch; + } +} + +// Animation Keyframes +// ======================================== + +@keyframes float { + + 0%, + 100% { + transform: translateY(0px); + } + + 50% { + transform: translateY(-10px); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.spec.ts new file mode 100644 index 0000000..39261a3 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MainPageComponent } from './main-page.component'; + +describe('MainPageComponent', () => { + let component: MainPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MainPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MainPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.ts b/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.ts new file mode 100644 index 0000000..4f82884 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/main-page/main-page.component.ts @@ -0,0 +1,20 @@ +import { Component, OnInit } from '@angular/core'; +import { ThemeService } from '../../../services/theme.service'; + +@Component({ + selector: 'app-main-page', + templateUrl: './main-page.component.html', + styleUrls: ['./main-page.component.scss'] +}) +export class MainPageComponent implements OnInit { + + constructor(private themeService: ThemeService) { } + + ngOnInit() { + // Initialize theme service + this.themeService.currentTheme$.subscribe(theme => { + // Theme changes will be automatically applied via CSS variables + }); + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts b/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts new file mode 100644 index 0000000..8164773 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts @@ -0,0 +1,542 @@ + + + + + + + + + + + + + + + + + + +import { Ad10Component } from './BuilderComponents/angulardatatype/Ad10/Ad10.component'; + + + + + + + + + + + + + + + + + + + + + + +import { DefatestComponent } from './BuilderComponents/defu/Defatest/Defatest.component'; + + +import { ChildformComponent } from './BuilderComponents/stpkg/Childform/Childform.component'; +import { DistrictComponent } from './BuilderComponents/testdata/District/District.component'; +import { StateComponent } from './BuilderComponents/testdata/State/State.component'; +import { CountryComponent } from './BuilderComponents/testdata/Country/Country.component'; +import { Ad9Component } from './BuilderComponents/angulardatatype/Ad9/Ad9.component'; +import { Ad8Component } from './BuilderComponents/angulardatatype/Ad8/Ad8.component'; +import { Ad7Component } from './BuilderComponents/angulardatatype/Ad7/Ad7.component'; +import { Ad6Component } from './BuilderComponents/angulardatatype/Ad6/Ad6.component'; +import { Adv5Component } from './BuilderComponents/angulardatatype/Adv5/Adv5.component'; +import { Adv4Component } from './BuilderComponents/angulardatatype/Adv4/Adv4.component'; +import { SupportComponent } from './BuilderComponents/angulardatatype/Support/Support.component'; +import { Adv3Component } from './BuilderComponents/angulardatatype/Adv3/Adv3.component'; +import { Dv2Component } from './BuilderComponents/angulardatatype/Dv2/Dv2.component'; +import { Adv1Component } from './BuilderComponents/angulardatatype/Adv1/Adv1.component'; +import { Basicp3Component } from './BuilderComponents/angulardatatype/Basicp3/Basicp3.component'; +import { Basicp2Component } from './BuilderComponents/angulardatatype/Basicp2/Basicp2.component'; +import { Basicp1Component } from './BuilderComponents/angulardatatype/Basicp1/Basicp1.component'; + + +import { SequencegenaratorComponent } from './fnd/sequencegenarator/sequencegenarator.component'; +import { Component, NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { MainPageComponent } from '../main/fnd/main-page/main-page.component'; +import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; +import { AboutComponent } from '../main/admin/about/about.component'; +import { LayoutComponent } from './layout/layout.component'; +import { UserComponent } from '../main/admin/user/user.component'; + +import { PasswordResetComponent } from '../main/admin/password-reset/password-reset.component'; +import { DashboardComponent } from '../main/fnd/dashboard/dashboard.component'; +import { AllMenuGroupComponent } from '../main/admin/menu-group/all/all-menu-group.component'; +import { EditMenuGroupComponent } from '../main/admin/menu-group/edit/edit-menu-group.component'; +import { MenuGroupComponent } from '../main/admin/menu-group/menu-group.component'; +import { ReadOnlyMenuGroupComponent } from '../main/admin/menu-group/read-only/readonly-menu-group.component'; +import { MenuRegisterComponent } from '../main/admin/menu-register/menu-register.component'; +import { AllMenurComponent } from '../main/admin/menu-register/all-menur/all-menur.component'; +import { AddMenurComponent } from '../main/admin/menu-register/add-menur/add-menur.component'; +import { EditMenurComponent } from '../main/admin/menu-register/edit-menur/edit-menur.component'; +import { ReadonlyMenurComponent } from '../main/admin/menu-register/readonly-menur/readonly-menur.component'; +import { ProfileSettingComponent } from '../main/admin/profile-setting/profile-setting.component'; +import { UsermaintanceComponent } from '../main/admin/usermaintance/usermaintance.component'; +import { UsermaintanceaddComponent } from '../main/admin/usermaintanceadd/usermaintanceadd.component'; +import { UsermaintanceeditComponent } from '../main/admin/usermaintanceedit/usermaintanceedit.component'; +import { UsergrpmaintenanceComponent } from '../main/admin/usergrpmaintenance/usergrpmaintenance.component'; +import { MenuaccesscontrolComponent } from '../main/admin/menuaccesscontrol/menuaccesscontrol.component'; +import { AuthGuard } from '../../services/auth_guard.service'; + +import { SystemparametersComponent } from '../main/admin/systemparameters/systemparameters.component'; +import { MenumaintanceComponent } from '../main/admin/menumaintance/menumaintance.component'; + +import { SubmenuComponent } from './admin/submenu/submenu.component'; + +import { Role } from '../../models/admin/role'; +import { AccesstypeComponent } from './admin/accesstype/accesstype.component'; +import { ModulesComponent } from './admin/modules/modules.component'; + +import { SessionloggerComponent } from './admin/sessionlogger/sessionlogger.component'; +import { ReportRunnerComponent } from './builder/report-runner/report-runner.component'; +import { ReportrunnerallComponent } from './builder/report-runner/reportrunnerall/reportrunnerall.component'; +import { Reportrunneredit2Component } from './builder/report-runner/reportrunneredit2/reportrunneredit2.component'; +import { ReportrunnereditComponent } from './builder/report-runner/reportrunneredit/reportrunneredit.component'; +import { ReportBuildComponent } from './builder/report-build/report-build.component'; +import { ReportbuildallComponent } from './builder/report-build/reportbuildall/reportbuildall.component'; +import { ReportbuildaddComponent } from './builder/report-build/reportbuildadd/reportbuildadd.component'; +import { ReportbuildeditComponent } from './builder/report-build/reportbuildedit/reportbuildedit.component'; +import { ReportbuildqueryComponent } from './builder/report-build/reportbuildquery/reportbuildquery.component'; +import { ReportBuild2Component } from './builder/report-build2/report-build2.component'; +import { ReportBuild2allComponent } from './builder/report-build2/report-build2all/report-build2all.component'; +import { ReportBuild2addComponent } from './builder/report-build2/report-build2add/report-build2add.component'; +import { ReportBuild2editComponent } from './builder/report-build2/report-build2edit/report-build2edit.component'; + + +import { DashboardnewComponent } from './builder/dashboardnew/dashboardnew.component'; +import { AllnewdashComponent } from './builder/dashboardnew/allnewdash/allnewdash.component'; +import { AddnewdashComponent } from './builder/dashboardnew/addnewdash/addnewdash.component'; +import { EditformnewdashComponent } from './builder/dashboardnew/editformnewdash/editformnewdash.component'; +import { EditnewdashComponent } from './builder/dashboardnew/editnewdash/editnewdash.component'; +import { ScheduleComponent } from './builder/dashboardnew/schedule/schedule.component'; +import { SetupiconComponent } from './builder/setupicon/setupicon.component'; +import { ExtensionComponent } from './fnd/extension/extension.component'; +import { AllextensionComponent } from './fnd/extension/allextension/allextension.component'; +import { AddextensionComponent } from './fnd/extension/addextension/addextension.component'; +import { EditextensionComponent } from './fnd/extension/editextension/editextension.component'; +import { DashboardrunnerComponent } from './builder/dashboardrunner/dashboardrunner.component'; +import { DashrunnerallComponent } from './builder/dashboardrunner/dashrunnerall/dashrunnerall.component'; +import { DashrunnerlineComponent } from './builder/dashboardrunner/dashrunnerline/dashrunnerline.component'; + +import { ApiregisteryComponent } from './fnd/apiregistery/apiregistery.component'; + +import { DatamanagementComponent } from './datamanagement/datamanagement/datamanagement.component'; +import { DatamananementworkflowComponent } from './datamanagement/datamananementworkflow/datamananementworkflow.component'; +import { BulkimportComponent } from './datamanagement/bulkimport/bulkimport.component'; +import { BulkimportallComponent } from './datamanagement/bulkimport/bulkimportall/bulkimportall.component'; +import { BulkimportaddComponent } from './datamanagement/bulkimport/bulkimportadd/bulkimportadd.component'; +import { BulkimporteditComponent } from './datamanagement/bulkimport/bulkimportedit/bulkimportedit.component'; +import { BulkimportlineComponent } from './datamanagement/bulkimport/bulkimportline/bulkimportline.component'; +import { BulkimporteditlineComponent } from './datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component'; +import { MappingruleComponent } from './datamanagement/mappingrule/mappingrule.component'; +import { MappingruleallComponent } from './datamanagement/mappingrule/mappingruleall/mappingruleall.component'; +import { MappingruleaddComponent } from './datamanagement/mappingrule/mappingruleadd/mappingruleadd.component'; +import { MappingruleeditComponent } from './datamanagement/mappingrule/mappingruleedit/mappingruleedit.component'; +import { Stepper_workflowComponent } from './BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component'; +import { AllapiregisteryComponent } from './fnd/apiregistery/allapiregistery/allapiregistery.component'; +import { AddapiregisteryComponent } from './fnd/apiregistery/addapiregistery/addapiregistery.component'; +import { EditapiregisteryComponent } from './fnd/apiregistery/editapiregistery/editapiregistery.component'; +import { ApiregisterylineComponent } from './fnd/apiregistery/Apiregisteryline/Apiregisteryline.component'; +import { Customer_informationComponent } from './BuilderComponents/angulardatatype/Customer_information/Customer_information.component'; +import { Deployment_typeComponent } from './BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component'; +import { ManufacturerComponent } from './BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component'; +import { Order_summaryComponent } from './BuilderComponents/angulardatatype/Order_summary/Order_summary.component'; +import { ProductComponent } from './BuilderComponents/angulardatatype/Product/Product.component'; +import { TypesComponent } from './BuilderComponents/angulardatatype/Types/Types.component'; +import { Test2Component } from './BuilderComponents/testdata/Test2/Test2.component'; +import { Token_registeryComponent } from './fnd/Token_registery/Token_registery.component'; +import { MyworkspaceComponent } from './admin/myworkspace/myworkspace.component'; +import { ThemeCustomizationComponent } from './theme-customization/theme-customization.component'; +// import { QueryComponent } from './superadmin/query/query.component'; +// import { QueryaddComponent } from './superadmin/queryadd/queryadd.component'; +// import { QueryeditComponent } from './superadmin/queryedit/queryedit.component'; + + + + +const routes: Routes = [ + //Important: The sequence of path is important as the router go over then in sequential manner + { path: '', redirectTo: '/cns-portal/dashboard', pathMatch: 'full' }, + { + path: 'cns-portal', + component: LayoutComponent, + canActivate: [AuthGuard], + children: [ + { path: '', redirectTo: 'user', pathMatch: 'full' }, + { path: 'main', component: MainPageComponent }, + { path: 'user', component: UserComponent }, + + + + + { path: 'usermaintance', component: UsermaintanceComponent }, + { path: 'usermaintanceadd', component: UsermaintanceaddComponent }, + { path: 'usermaintancedit/:id', component: UsermaintanceeditComponent }, + { path: 'usergrpmaintance', component: UsergrpmaintenanceComponent }, + { path: 'menuaccess', component: MenuaccesscontrolComponent }, + { path: 'systemparameters', component: SystemparametersComponent }, + { path: 'menumaintance', component: MenumaintanceComponent }, + { path: 'submenu/:id', component: SubmenuComponent }, + + { path: 'passwordreset', component: PasswordResetComponent }, + { path: 'profile-settings', component: ProfileSettingComponent }, + { path: 'about', component: AboutComponent }, + { path: 'setupicon', component: SetupiconComponent }, + { path: 'myworkspace', component: MyworkspaceComponent }, + { path: 'theme-customization', component: ThemeCustomizationComponent }, + + + + { + path: 'reportbuild', component: ReportBuildComponent, + children: [ + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: ReportbuildallComponent }, + { path: 'add', component: ReportbuildaddComponent }, + { path: 'edit/:id', component: ReportbuildeditComponent }, + { path: 'reportQuery/:id', component: ReportbuildqueryComponent }, + + + //SUPER ADMIN + // { path: 'query', component: QueryComponent, canActivate: [AuthGuard], data: { roles: [Role.Admin] } }, + // { path: 'reportQuery/:id/queryadd', component: QueryaddComponent, canActivate: [AuthGuard], data: { roles: [Role.Admin] } }, + // { path: 'reportQuery/queryedit/:id', component: QueryeditComponent, canActivate: [AuthGuard], data: { roles: [Role.Admin] } }, + + + + ] + }, + + // {path:'rerunner',component:DatefunctionComponent}, + + { + path: 'reportbuild2', component: ReportBuild2Component, + children: [ + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: ReportBuild2allComponent }, + { path: 'add', component: ReportBuild2addComponent }, + { path: 'edit/:id', component: ReportBuild2editComponent }, + ] + }, + + //report runner + { + path: 'rerunner', component: ReportRunnerComponent, + children: [ + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: ReportrunnerallComponent }, + { path: 'runner2/:id', component: Reportrunneredit2Component }, + { path: 'runner/:id', component: ReportrunnereditComponent }, + ] + }, + + // dashboardbuilder + { + path: 'dashboardbuilder', component: DashboardnewComponent, + children: [ + + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: AllnewdashComponent }, + { path: 'adddata', component: AddnewdashComponent }, + { path: 'editdata/:id', component: EditformnewdashComponent }, + { path: 'editdashn/:id', component: EditnewdashComponent }, + { path: 'schedule/:id', component: ScheduleComponent }, + ] + }, + + { + path: 'dashboardrunner', component: DashboardrunnerComponent, + children: [ + + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: DashrunnerallComponent }, + { path: 'dashrunner/:id', component: DashrunnerlineComponent }, + ] + }, + + + { path: 'accesstype', component: AccesstypeComponent }, + { path: 'acmodules', component: ModulesComponent }, + { path: 'sessionlogger', component: SessionloggerComponent }, + { path: 'dashboard', component: DashboardComponent, }, + + { + path: 'menu-group', component: MenuGroupComponent, + children: [ + { path: '', redirectTo: 'all-menu', pathMatch: 'full' }, + { path: 'all-menu', component: AllMenuGroupComponent }, + { path: 'edit-menu', component: EditMenuGroupComponent }, + { path: 'read-only', component: ReadOnlyMenuGroupComponent } + ], + }, + + { + path: 'menu-r', component: MenuRegisterComponent, + children: [ + { path: '', redirectTo: 'all-r', pathMatch: 'full' }, + { path: 'all-r', component: AllMenurComponent }, + { path: 'add-r', component: AddMenurComponent }, + { path: 'edit-r', component: EditMenurComponent }, + { path: 'readonly-r', component: ReadonlyMenurComponent } + ], + }, + + { + path: 'extension', component: ExtensionComponent, + children: [ + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: AllextensionComponent }, + { path: 'add', component: AddextensionComponent }, + { path: 'edit/:id', component: EditextensionComponent }, + ], + }, + { path: 'SequenceGenerator', component: SequencegenaratorComponent }, + + // Api registery + + { + path: 'apiregistery', component: ApiregisteryComponent, + children: [ + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: AllapiregisteryComponent }, + { path: 'add', component: AddapiregisteryComponent }, + { path: 'edit/:id', component: EditapiregisteryComponent }, + { path: 'line/:id', component: ApiregisterylineComponent }, + + ], + }, + + // DATA MANAGEMENT + + { path: 'datamanagement', component: DatamanagementComponent }, + { path: 'dataworkflow/:id', component: DatamananementworkflowComponent }, + + //bulk Import Rule + { + path: 'validationrule', component: BulkimportComponent, + children: [ + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: BulkimportallComponent }, + { path: 'add', component: BulkimportaddComponent }, + { path: 'edit/:id', component: BulkimporteditComponent }, + { path: 'ruleline', component: BulkimportlineComponent }, + { path: 'rulelineedit', component: BulkimporteditlineComponent }, + ], + }, + //bulk Import Rule mapping + { + path: 'mappingrule', component: MappingruleComponent, + children: [ + { path: '', redirectTo: 'all', pathMatch: 'full' }, + { path: 'all', component: MappingruleallComponent }, + { path: 'add', component: MappingruleaddComponent }, + { path: 'edit/:id', component: MappingruleeditComponent }, + ], + }, + + + // buildercomponents + + + + + + + + + { path: 'Country', component: CountryComponent }, + + + { path: 'Adv3', component: Adv3Component }, + + + + + + + + + + + + + + + + + + + + + + + + + + + { path: 'Ad10', component: Ad10Component }, + + + { path: 'Childform', component: ChildformComponent }, + + + { path: 'District', component: DistrictComponent }, + + + { path: 'State', component: StateComponent }, + + + { path: 'Country', component: CountryComponent }, + + + { path: 'Ad9', component: Ad9Component }, + + + { path: 'Ad8', component: Ad8Component }, + + + { path: 'Ad7', component: Ad7Component }, + + + + + + + + + + + + + + + + + + + { path: 'Ad6', component: Ad6Component }, + + + { path: 'Adv5', component: Adv5Component }, + + + { path: 'Support', component: SupportComponent }, + + + { path: 'Adv3', component: Adv3Component }, + + + { path: 'tokenregistery', component: Token_registeryComponent }, + + + { path: 'Defatest', component: DefatestComponent }, + + + { path: 'Country', component: CountryComponent }, + + + { path: 'Defatest', component: DefatestComponent }, + + { path: 'Test2', component: Test2Component }, + + + { path: 'Country', component: CountryComponent }, + + + + { path: 'Test2', component: Test2Component }, + + { path: 'Childform', component: ChildformComponent }, + + + { path: 'District', component: DistrictComponent }, + + + { path: 'State', component: StateComponent }, + + + { path: 'Country', component: CountryComponent }, + + + { path: 'Ad9', component: Ad9Component }, + + + { path: 'Ad8', component: Ad8Component }, + + + { path: 'Ad7', component: Ad7Component }, + + + { path: 'Ad6', component: Ad6Component }, + + + { path: 'Adv5', component: Adv5Component }, + + + { path: 'Adv4', component: Adv4Component }, + + + { path: 'Support', component: SupportComponent }, + + + { path: 'Adv3', component: Adv3Component }, + + + { path: 'Dv2', component: Dv2Component }, + + + { path: 'Adv1', component: Adv1Component }, + + + { path: 'Basicp3', component: Basicp3Component }, + + + { path: 'Basicp2', component: Basicp2Component }, + + + { path: 'Basicp1', component: Basicp1Component }, + { path: 'cust', component: Customer_informationComponent }, + + { path: 'Order_summary', component: Order_summaryComponent }, + + + { path: 'Types', component: TypesComponent }, + + + { path: 'Product', component: ProductComponent }, + + + { path: 'Manufacturer', component: ManufacturerComponent }, + + + { path: 'Deployment_type', component: Deployment_typeComponent }, + + + + + { path: 'Stepper_workflow', component: Stepper_workflowComponent }, + + + { path: '**', component: PageNotFoundComponent }, + + ] + }, + +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class MainRoutingModule { } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/main.module.ts b/frontend/angular-clarity-master/src/app/modules/main/main.module.ts new file mode 100644 index 0000000..d8b4c69 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/main.module.ts @@ -0,0 +1,236 @@ +import { Ad10Component } from './BuilderComponents/angulardatatype/Ad10/Ad10.component'; + +import { DefatestComponent } from './BuilderComponents/defu/Defatest/Defatest.component'; + +import { ChildformComponent } from './BuilderComponents/stpkg/Childform/Childform.component'; +import { DistrictComponent } from './BuilderComponents/testdata/District/District.component'; +import { StateComponent } from './BuilderComponents/testdata/State/State.component'; +import { CountryComponent } from './BuilderComponents/testdata/Country/Country.component'; +import { Ad9Component } from './BuilderComponents/angulardatatype/Ad9/Ad9.component'; +import { Ad8Component } from './BuilderComponents/angulardatatype/Ad8/Ad8.component'; +import { Ad7Component } from './BuilderComponents/angulardatatype/Ad7/Ad7.component'; +import { Ad6Component } from './BuilderComponents/angulardatatype/Ad6/Ad6.component'; +import { Adv5Component } from './BuilderComponents/angulardatatype/Adv5/Adv5.component'; +import { Adv4Component } from './BuilderComponents/angulardatatype/Adv4/Adv4.component'; +import { SupportComponent } from './BuilderComponents/angulardatatype/Support/Support.component'; +import { Adv3Component } from './BuilderComponents/angulardatatype/Adv3/Adv3.component'; +import { Dv2Component } from './BuilderComponents/angulardatatype/Dv2/Dv2.component'; +import { Adv1Component } from './BuilderComponents/angulardatatype/Adv1/Adv1.component'; +import { Basicp3Component } from './BuilderComponents/angulardatatype/Basicp3/Basicp3.component'; +import { Basicp2Component } from './BuilderComponents/angulardatatype/Basicp2/Basicp2.component'; +import { Basicp1Component } from './BuilderComponents/angulardatatype/Basicp1/Basicp1.component'; + + + +import { CommonModule } from '@angular/common'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ClarityModule } from '@clr/angular'; + +import { MainPageComponent } from '../main/fnd/main-page/main-page.component'; +import { MainRoutingModule } from './main-routing.module'; +import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; +// import { AboutComponent } from '../main/admin/about/about.component'; +// import { LayoutComponent } from './layout/layout.component'; +import { HelperModule } from 'src/app/pipes/helpers.module'; +import { PasswordResetComponent } from '../main/admin/password-reset/password-reset.component'; +import { UserComponent } from '../main/admin/user/user.component'; + + +import { AllMenuGroupComponent } from '../main/admin/menu-group/all/all-menu-group.component'; +import { EditMenuGroupComponent } from '../main/admin/menu-group/edit/edit-menu-group.component'; +import { MenuGroupComponent } from '../main/admin/menu-group/menu-group.component'; +import { ReadOnlyMenuGroupComponent } from '../main/admin/menu-group/read-only/readonly-menu-group.component'; +import { AddMenurComponent } from '../main/admin/menu-register/add-menur/add-menur.component'; +import { AllMenurComponent } from '../main/admin/menu-register/all-menur/all-menur.component'; +import { EditMenurComponent } from '../main/admin/menu-register/edit-menur/edit-menur.component'; +import { MenuRegisterComponent } from '../main/admin/menu-register/menu-register.component'; +import { ReadonlyMenurComponent } from '../main/admin/menu-register/readonly-menur/readonly-menur.component'; +import { ProfileSettingComponent } from '../main/admin/profile-setting/profile-setting.component'; +import { UsermaintanceaddComponent } from '../main/admin/usermaintanceadd/usermaintanceadd.component'; +import { UsermaintanceeditComponent } from '../main/admin/usermaintanceedit/usermaintanceedit.component'; + +import { DragDropModule } from '@angular/cdk/drag-drop'; +import { HttpClientModule } from '@angular/common/http'; +import { CodemirrorModule } from "@ctrl/ngx-codemirror"; +import { NgxChartsModule } from '@swimlane/ngx-charts'; +import { GridsterModule } from 'angular-gridster2'; +import { DynamicModule } from 'ng-dynamic-component'; +import { NgChartsModule } from 'ng2-charts'; +import { CKEditorModule } from 'ng2-ckeditor'; + +import { UserRegistrationComponent } from '../main/admin/user-registration/user-registration.component'; + +import { QRCodeModule } from 'angularx-qrcode'; +import { TagInputModule } from 'ngx-chips'; +import { CookieService } from 'ngx-cookie-service'; +import { ImageCropperModule } from 'ngx-image-cropper'; +import { ModulesComponent } from './admin/modules/modules.component'; +import { SessionloggerComponent } from './admin/sessionlogger/sessionlogger.component'; +import { SubmenuComponent } from './admin/submenu/submenu.component'; + +import { WireframeService } from 'src/app/services/builder/wireframe.service'; +import { ReportBuildComponent } from './builder/report-build/report-build.component'; +import { ReportbuildeditComponent } from './builder/report-build/reportbuildedit/reportbuildedit.component'; +import { ReportbuildqueryComponent } from './builder/report-build/reportbuildquery/reportbuildquery.component'; +import { ReportBuild2Component } from './builder/report-build2/report-build2.component'; +import { ReportBuild2editComponent } from './builder/report-build2/report-build2edit/report-build2edit.component'; +import { ReportRunnerComponent } from './builder/report-runner/report-runner.component'; +import { ReportrunnereditComponent } from './builder/report-runner/reportrunneredit/reportrunneredit.component'; +import { Reportrunneredit2Component } from './builder/report-runner/reportrunneredit2/reportrunneredit2.component'; + + +import { DashboardnewComponent } from './builder/dashboardnew/dashboardnew.component'; +import { EditformnewdashComponent } from './builder/dashboardnew/editformnewdash/editformnewdash.component'; +import { EditnewdashComponent } from './builder/dashboardnew/editnewdash/editnewdash.component'; +import { BarChartComponent } from './builder/dashboardnew/gadgets/bar-chart/bar-chart.component'; +import { BubbleChartComponent } from './builder/dashboardnew/gadgets/bubble-chart/bubble-chart.component'; +import { DoughnutChartComponent } from './builder/dashboardnew/gadgets/doughnut-chart/doughnut-chart.component'; +import { DynamicChartComponent } from './builder/dashboardnew/gadgets/dynamic-chart/dynamic-chart.component'; +import { FinancialChartComponent } from './builder/dashboardnew/gadgets/financial-chart/financial-chart.component'; +import { GridViewComponent } from './builder/dashboardnew/gadgets/grid-view/grid-view.component'; +import { LineChartComponent } from './builder/dashboardnew/gadgets/line-chart/line-chart.component'; +import { PieChartComponent } from './builder/dashboardnew/gadgets/pie-chart/pie-chart.component'; +import { PolarChartComponent } from './builder/dashboardnew/gadgets/polar-chart/polar-chart.component'; +import { RadarChartComponent } from './builder/dashboardnew/gadgets/radar-chart/radar-chart.component'; +import { ScatterChartComponent } from './builder/dashboardnew/gadgets/scatter-chart/scatter-chart.component'; +import { ToDoChartComponent } from './builder/dashboardnew/gadgets/to-do-chart/to-do-chart.component'; +import { ScheduleComponent } from './builder/dashboardnew/schedule/schedule.component'; +import { AddextensionComponent } from './fnd/extension/addextension/addextension.component'; +import { AllextensionComponent } from './fnd/extension/allextension/allextension.component'; +import { EditextensionComponent } from './fnd/extension/editextension/editextension.component'; +import { ExtensionComponent } from './fnd/extension/extension.component'; + +import { BarRunnerComponent } from './builder/dashboardrunner/dashrunnerline/bar-runner/bar-runner.component'; +import { BubbleRunnerComponent } from './builder/dashboardrunner/dashrunnerline/bubble-runner/bubble-runner.component'; +import { DashrunnerlineComponent } from './builder/dashboardrunner/dashrunnerline/dashrunnerline.component'; +import { DoughnutRunnerComponent } from './builder/dashboardrunner/dashrunnerline/doughnut-runner/doughnut-runner.component'; +import { GridRunnerComponent } from './builder/dashboardrunner/dashrunnerline/grid-runner/grid-runner.component'; +import { LineRunnerComponent } from './builder/dashboardrunner/dashrunnerline/line-runner/line-runner.component'; +import { PieRunnerComponent } from './builder/dashboardrunner/dashrunnerline/pie-runner/pie-runner.component'; +import { PolarRunnerComponent } from './builder/dashboardrunner/dashrunnerline/polar-runner/polar-runner.component'; +import { RadarRunnerComponent } from './builder/dashboardrunner/dashrunnerline/radar-runner/radar-runner.component'; +import { ScatterRunnerComponent } from './builder/dashboardrunner/dashrunnerline/scatter-runner/scatter-runner.component'; +import { TodoRunnerComponent } from './builder/dashboardrunner/dashrunnerline/todo-runner/todo-runner.component'; + +import { ApiregisteryComponent } from './fnd/apiregistery/apiregistery.component'; + +import { BulkimportComponent } from './datamanagement/bulkimport/bulkimport.component'; +import { BulkimportaddComponent } from './datamanagement/bulkimport/bulkimportadd/bulkimportadd.component'; +import { BulkimportallComponent } from './datamanagement/bulkimport/bulkimportall/bulkimportall.component'; +import { BulkimporteditComponent } from './datamanagement/bulkimport/bulkimportedit/bulkimportedit.component'; +import { BulkimporteditlineComponent } from './datamanagement/bulkimport/bulkimporteditline/bulkimporteditline.component'; +import { BulkimportlineComponent } from './datamanagement/bulkimport/bulkimportline/bulkimportline.component'; +import { DatamanagementComponent } from './datamanagement/datamanagement/datamanagement.component'; +import { DatamananementworkflowComponent } from './datamanagement/datamananementworkflow/datamananementworkflow.component'; +import { MappingruleComponent } from './datamanagement/mappingrule/mappingrule.component'; +import { MappingruleaddComponent } from './datamanagement/mappingrule/mappingruleadd/mappingruleadd.component'; +import { MappingruleallComponent } from './datamanagement/mappingrule/mappingruleall/mappingruleall.component'; +import { MappingruleeditComponent } from './datamanagement/mappingrule/mappingruleedit/mappingruleedit.component'; +import { Stepper_workflowComponent } from './BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component'; +import { AllapiregisteryComponent } from './fnd/apiregistery/allapiregistery/allapiregistery.component'; +import { AddapiregisteryComponent } from './fnd/apiregistery/addapiregistery/addapiregistery.component'; +import { EditapiregisteryComponent } from './fnd/apiregistery/editapiregistery/editapiregistery.component'; +import { ApiregisterylineComponent } from './fnd/apiregistery/Apiregisteryline/Apiregisteryline.component'; +import { Customer_informationComponent } from './BuilderComponents/angulardatatype/Customer_information/Customer_information.component'; +import { Deployment_typeComponent } from './BuilderComponents/angulardatatype/Deployment_type/Deployment_type.component'; +import { ManufacturerComponent } from './BuilderComponents/angulardatatype/Manufacturer/Manufacturer.component'; +import { Order_summaryComponent } from './BuilderComponents/angulardatatype/Order_summary/Order_summary.component'; +import { ProductComponent } from './BuilderComponents/angulardatatype/Product/Product.component'; +import { TypesComponent } from './BuilderComponents/angulardatatype/Types/Types.component'; +import { Test2Component } from './BuilderComponents/testdata/Test2/Test2.component'; +import { Token_registeryComponent } from './fnd/Token_registery/Token_registery.component'; +import { MyworkspaceComponent } from './admin/myworkspace/myworkspace.component'; +import { ThemeCustomizationComponent } from './theme-customization/theme-customization.component'; +// import { QueryComponent } from './superadmin/query/query.component'; +// import { QueryaddComponent } from './superadmin/queryadd/queryadd.component'; +// import { QueryeditComponent } from './superadmin/queryedit/queryedit.component'; + +import { FieldTypesModule } from '../../shared/components/field-types/field-types.module'; +import { SharedModule } from '../../shared/shared.module'; + +@NgModule({ + declarations: [ + MainPageComponent, PageNotFoundComponent, UserComponent, PasswordResetComponent, + MyworkspaceComponent, + ReportRunnerComponent, ReportrunnereditComponent, Reportrunneredit2Component, MenuGroupComponent, AllMenuGroupComponent, EditMenuGroupComponent, ReadOnlyMenuGroupComponent, UserRegistrationComponent, + MenuRegisterComponent, AddMenurComponent, EditMenurComponent, AllMenurComponent, ReadonlyMenurComponent, ProfileSettingComponent, + UsermaintanceaddComponent, UsermaintanceeditComponent, + SubmenuComponent, ModulesComponent, SessionloggerComponent, + DashboardnewComponent, EditformnewdashComponent, EditnewdashComponent, ScheduleComponent, + DoughnutChartComponent, LineChartComponent, RadarChartComponent, BarChartComponent, BubbleChartComponent, DynamicChartComponent, ScatterChartComponent, PolarChartComponent, PieChartComponent, FinancialChartComponent, ToDoChartComponent, GridViewComponent, + DashrunnerlineComponent, BarRunnerComponent, LineRunnerComponent, DoughnutRunnerComponent, GridRunnerComponent, PieRunnerComponent, PolarRunnerComponent, RadarRunnerComponent, ScatterRunnerComponent, TodoRunnerComponent, BubbleRunnerComponent, + ReportBuildComponent, ReportbuildeditComponent, ReportbuildqueryComponent, ReportBuild2Component, ReportBuild2editComponent, + // QueryComponent, QueryaddComponent, QueryeditComponent, + ExtensionComponent, + AllextensionComponent, + AddextensionComponent, EditextensionComponent, ApiregisteryComponent, AllapiregisteryComponent, AddapiregisteryComponent, EditapiregisteryComponent, + + ApiregisterylineComponent, + DatamanagementComponent, DatamananementworkflowComponent, BulkimportComponent, BulkimportallComponent, BulkimportaddComponent, BulkimporteditComponent, BulkimportlineComponent, BulkimporteditlineComponent, MappingruleComponent, MappingruleallComponent, + MappingruleaddComponent, + MappingruleeditComponent, Stepper_workflowComponent, Customer_informationComponent, + // FileUploadListComponent, + + + // buildercomponents + + + ThemeCustomizationComponent, + Ad10Component, + Token_registeryComponent, + DefatestComponent, + Test2Component, + Order_summaryComponent, + TypesComponent, + ProductComponent, + ManufacturerComponent, + Deployment_typeComponent, + ChildformComponent, + DistrictComponent, + StateComponent, + CountryComponent, + Ad9Component, + Ad8Component, + Ad7Component, + Ad6Component, + Adv5Component, + Adv4Component, + SupportComponent, + Adv3Component, + Dv2Component, + Adv1Component, + Basicp3Component, + Basicp2Component, + Basicp1Component, + ], + imports: [ + QRCodeModule, + CommonModule, + FormsModule, + ReactiveFormsModule, + ClarityModule, + HelperModule, + MainRoutingModule, + DragDropModule, + HttpClientModule, + ImageCropperModule, + TagInputModule, + CodemirrorModule, + CKEditorModule, + GridsterModule, + NgChartsModule, + NgxChartsModule, + DynamicModule, + FieldTypesModule, + SharedModule, + ], + providers: [ + CookieService, + WireframeService, + + + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class MainModule { } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.html b/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.html new file mode 100644 index 0000000..d5c848c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.html @@ -0,0 +1,5 @@ +
+ +

error 404

+ Not found your page requested. +
diff --git a/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.scss b/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.scss new file mode 100644 index 0000000..f1d5656 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.scss @@ -0,0 +1,11 @@ +clr-icon { + margin-top: 8%; + opacity: 0.3; + filter: alpha(opacity=30); /* For IE8 and earlier */ +} + +clr-icon:hover { + margin-top: 8%; + opacity: 8.0; + filter: alpha(opacity=80); /* For IE8 and earlier */ +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.spec.ts b/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.spec.ts new file mode 100644 index 0000000..697a946 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PageNotFoundComponent } from './page-not-found.component'; + +describe('PageNotFoundComponent', () => { + let component: PageNotFoundComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PageNotFoundComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PageNotFoundComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.ts b/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.ts new file mode 100644 index 0000000..31ae4d8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/page-not-found/page-not-found.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-page-not-found', + templateUrl: './page-not-found.component.html', + styleUrls: ['./page-not-found.component.scss'] +}) +export class PageNotFoundComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/superadmin.zip b/frontend/angular-clarity-master/src/app/modules/main/superadmin.zip new file mode 100644 index 0000000..06627f6 Binary files /dev/null and b/frontend/angular-clarity-master/src/app/modules/main/superadmin.zip differ diff --git a/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.html b/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.html new file mode 100644 index 0000000..70951d2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.html @@ -0,0 +1,280 @@ + +
+ +
+
+
+

+ + Theme Customization +

+

Customize your application's appearance with colors, fonts, and styles

+
+
+ + +
+
+
+ + +
+
+ +
+ + + +
+ + +
+
+
+
+ +
+

Choose a Theme

+

Select from our predefined themes or create your own custom theme to match your brand and + preferences.

+
+

Current Theme: {{ currentTheme.name }}

+
+
+
+
+
Sample Text +
+
Secondary Text
+
+
+
+
+
+
+ +
+ +
+

Customize Your Theme

+
+ + +
+
+ + +
+

+ + Colors +

+
+
+ +
+ + +
+
+
+
+
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+
+
+ + +
+

+ + Typography +

+
+
+ + +
+ The quick brown fox jumps over the lazy dog +
+
+ +
+ + +
+ The quick brown fox jumps over the lazy dog +
+
+ +
+ + +
+ The quick brown fox jumps over the lazy dog +
+
+
+
+ + +
+

+ + Advanced Settings +

+
+
+ +
+ + {{ getBorderRadiusValue() }} +
+
+ +
+ +
+ + {{ getShadowValueNumber() }}px +
+
+
+
+ + +
+

+ + Import/Export +

+
+
+ + + +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.scss b/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.scss new file mode 100644 index 0000000..b294bc2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.scss @@ -0,0 +1,622 @@ +// ======================================== +// THEME CUSTOMIZATION COMPONENT STYLES +// ======================================== +@import '../../../../styles/design-tokens'; + +// Main Container +// ======================================== + +.theme-customization-screen { + min-height: 100vh; + background: var(--theme-background, $gray-50); + padding: $space-6; +} + +// Header +// ======================================== + +.theme-header { + background: var(--theme-surface, $white); + border-radius: $radius-2xl; + box-shadow: var(--theme-shadow, $shadow-lg); + margin-bottom: $space-8; + padding: $space-6; + + .header-content { + display: flex; + align-items: center; + justify-content: space-between; + gap: $space-4; + + @media (max-width: $breakpoint-md) { + flex-direction: column; + align-items: flex-start; + } + } + + .header-left { + .page-title { + display: flex; + align-items: center; + gap: $space-3; + font-size: $text-3xl; + font-weight: $font-bold; + color: var(--theme-text, $gray-900); + margin-bottom: $space-2; + + clr-icon { + color: var(--theme-primary, $primary-500); + } + } + + .page-subtitle { + font-size: $text-lg; + color: var(--theme-text-secondary, $gray-600); + margin: 0; + } + } + + .header-actions { + display: flex; + gap: $space-3; + flex-shrink: 0; + + @media (max-width: $breakpoint-md) { + width: 100%; + justify-content: stretch; + } + } +} + +// Main Content +// ======================================== + +.theme-content { + .theme-layout { + display: grid; + grid-template-columns: 350px 1fr; + gap: $space-8; + min-height: 600px; + + @media (max-width: $breakpoint-lg) { + grid-template-columns: 1fr; + gap: $space-6; + } + } +} + +// Sidebar +// ======================================== + +.theme-sidebar { + background: var(--theme-surface, $white); + border-radius: $radius-2xl; + box-shadow: var(--theme-shadow, $shadow-lg); + padding: $space-6; + height: fit-content; + + .sidebar-section { + margin-bottom: $space-6; + + &:last-child { + margin-bottom: 0; + } + } + + .section-title { + font-size: $text-lg; + font-weight: $font-semibold; + color: var(--theme-text, $gray-900); + margin-bottom: $space-4; + } + + .theme-grid { + display: grid; + grid-template-columns: 1fr; + gap: $space-4; + } + + .theme-card { + border: 2px solid transparent; + border-radius: $radius-xl; + padding: $space-4; + cursor: pointer; + transition: all $duration-200 $ease-out; + background: var(--theme-surface, $white); + + &:hover { + border-color: var(--theme-primary, $primary-200); + transform: translateY(-2px); + box-shadow: var(--theme-shadow, $shadow-lg); + } + + &.active { + border-color: var(--theme-primary, $primary-500); + box-shadow: 0 0 0 3px rgba(var(--theme-primary, $primary-500), 0.1); + } + + .theme-preview { + height: 80px; + border-radius: $radius-lg; + overflow: hidden; + margin-bottom: $space-3; + position: relative; + + .preview-header { + height: 20px; + width: 100%; + } + + .preview-content { + padding: $space-3; + height: 60px; + display: flex; + align-items: center; + justify-content: center; + + .preview-card { + width: 100%; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + + .preview-text { + font-size: $text-xs; + font-weight: $font-medium; + } + } + } + } + + .theme-info { + .theme-name { + font-size: $text-sm; + font-weight: $font-semibold; + color: var(--theme-text, $gray-900); + margin-bottom: $space-2; + } + + .theme-colors { + display: flex; + gap: $space-2; + + .color-dot { + width: 16px; + height: 16px; + border-radius: 50%; + border: 2px solid var(--theme-surface, $white); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + } + } + } + } +} + +// Main Panel +// ======================================== + +.theme-main { + background: var(--theme-surface, $white); + border-radius: $radius-2xl; + box-shadow: var(--theme-shadow, $shadow-lg); + padding: $space-6; + min-height: 600px; +} + +// Welcome State +// ======================================== + +.welcome-state { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + min-height: 400px; + + .welcome-content { + text-align: center; + max-width: 500px; + + .welcome-icon { + margin-bottom: $space-6; + + clr-icon { + color: var(--theme-primary, $primary-500); + } + } + + h2 { + font-size: $text-2xl; + font-weight: $font-bold; + color: var(--theme-text, $gray-900); + margin-bottom: $space-4; + } + + p { + font-size: $text-lg; + color: var(--theme-text-secondary, $gray-600); + margin-bottom: $space-8; + line-height: 1.6; + } + + .current-theme-info { + h3 { + font-size: $text-xl; + font-weight: $font-semibold; + color: var(--theme-text, $gray-900); + margin-bottom: $space-4; + } + + .theme-preview-large { + height: 120px; + border-radius: $radius-xl; + overflow: hidden; + position: relative; + box-shadow: var(--theme-shadow, $shadow-lg); + + .preview-header { + height: 30px; + width: 100%; + } + + .preview-content { + padding: $space-4; + height: 90px; + display: flex; + align-items: center; + justify-content: center; + + .preview-card { + width: 100%; + height: 50px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + + .preview-text { + font-size: $text-sm; + font-weight: $font-semibold; + margin-bottom: 2px; + } + + .preview-text-secondary { + font-size: $text-xs; + } + } + } + } + } + } +} + +// Customization Panel +// ======================================== + +.customization-panel { + .customization-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: $space-8; + padding-bottom: $space-4; + border-bottom: 1px solid var(--theme-text-secondary, $gray-200); + + h2 { + font-size: $text-2xl; + font-weight: $font-bold; + color: var(--theme-text, $gray-900); + margin: 0; + } + + .header-actions { + display: flex; + gap: $space-3; + } + } + + .customization-section { + margin-bottom: $space-8; + + &:last-child { + margin-bottom: 0; + } + + .section-title { + display: flex; + align-items: center; + gap: $space-2; + font-size: $text-lg; + font-weight: $font-semibold; + color: var(--theme-text, $gray-900); + margin-bottom: $space-4; + + clr-icon { + color: var(--theme-primary, $primary-500); + } + } + } +} + +// Color Customization +// ======================================== + +.color-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: $space-6; + + @media (max-width: $breakpoint-md) { + grid-template-columns: 1fr; + } +} + +.color-group { + .color-label { + display: block; + font-size: $text-sm; + font-weight: $font-medium; + color: var(--theme-text, $gray-700); + margin-bottom: $space-2; + } + + .color-input-group { + display: flex; + gap: $space-2; + margin-bottom: $space-3; + + .color-picker { + width: 40px; + height: 40px; + border: none; + border-radius: $radius-lg; + cursor: pointer; + overflow: hidden; + + &::-webkit-color-swatch-wrapper { + padding: 0; + } + + &::-webkit-color-swatch { + border: none; + border-radius: $radius-lg; + } + } + + .color-text { + flex: 1; + padding: $space-2 $space-3; + border: 1px solid var(--theme-text-secondary, $gray-300); + border-radius: $radius-lg; + font-size: $text-sm; + color: var(--theme-text, $gray-900); + background: var(--theme-surface, $white); + + &:focus { + outline: none; + border-color: var(--theme-primary, $primary-500); + box-shadow: 0 0 0 3px rgba(var(--theme-primary, $primary-500), 0.1); + } + } + } + + .color-presets { + display: flex; + gap: $space-2; + flex-wrap: wrap; + + .preset-color { + width: 24px; + height: 24px; + border-radius: 50%; + cursor: pointer; + border: 2px solid var(--theme-surface, $white); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + transition: transform $duration-200 $ease-out; + + &:hover { + transform: scale(1.1); + } + } + } +} + +// Font Customization +// ======================================== + +.font-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: $space-6; + + @media (max-width: $breakpoint-md) { + grid-template-columns: 1fr; + } +} + +.font-group { + .font-label { + display: block; + font-size: $text-sm; + font-weight: $font-medium; + color: var(--theme-text, $gray-700); + margin-bottom: $space-2; + } + + .font-select { + width: 100%; + padding: $space-2 $space-3; + border: 1px solid var(--theme-text-secondary, $gray-300); + border-radius: $radius-lg; + font-size: $text-sm; + color: var(--theme-text, $gray-900); + background: var(--theme-surface, $white); + margin-bottom: $space-3; + + &:focus { + outline: none; + border-color: var(--theme-primary, $primary-500); + box-shadow: 0 0 0 3px rgba(var(--theme-primary, $primary-500), 0.1); + } + } + + .font-preview { + padding: $space-3; + background: var(--theme-background, $gray-50); + border-radius: $radius-lg; + font-size: $text-sm; + color: var(--theme-text, $gray-700); + border: 1px solid var(--theme-text-secondary, $gray-200); + } +} + +// Advanced Settings +// ======================================== + +.advanced-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: $space-6; + + @media (max-width: $breakpoint-md) { + grid-template-columns: 1fr; + } +} + +.advanced-group { + .advanced-label { + display: block; + font-size: $text-sm; + font-weight: $font-medium; + color: var(--theme-text, $gray-700); + margin-bottom: $space-2; + } + + .range-input-group { + display: flex; + align-items: center; + gap: $space-3; + + .range-slider { + flex: 1; + height: 6px; + border-radius: 3px; + background: var(--theme-text-secondary, $gray-300); + outline: none; + cursor: pointer; + + &::-webkit-slider-thumb { + appearance: none; + width: 20px; + height: 20px; + border-radius: 50%; + background: var(--theme-primary, $primary-500); + cursor: pointer; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + } + + &::-moz-range-thumb { + width: 20px; + height: 20px; + border-radius: 50%; + background: var(--theme-primary, $primary-500); + cursor: pointer; + border: none; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + } + } + + .range-value { + font-size: $text-sm; + font-weight: $font-medium; + color: var(--theme-text, $gray-700); + min-width: 60px; + text-align: center; + } + } +} + +// Import/Export +// ======================================== + +.import-export-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: $space-6; + + @media (max-width: $breakpoint-md) { + grid-template-columns: 1fr; + } +} + +.import-group { + .import-label { + display: block; + font-size: $text-sm; + font-weight: $font-medium; + color: var(--theme-text, $gray-700); + margin-bottom: $space-2; + } + + .file-input { + display: none; + } +} + +// Responsive Design +// ======================================== + +@media (max-width: $breakpoint-lg) { + .theme-customization-screen { + padding: $space-4; + } + + .theme-header { + padding: $space-4; + } + + .theme-sidebar, + .theme-main { + padding: $space-4; + } +} + +@media (max-width: $breakpoint-md) { + .theme-customization-screen { + padding: $space-3; + } + + .theme-header { + padding: $space-3; + } + + .theme-sidebar, + .theme-main { + padding: $space-3; + } + + .color-grid, + .font-grid, + .advanced-grid, + .import-export-grid { + grid-template-columns: 1fr; + } +} + +@media (max-width: $breakpoint-sm) { + .theme-customization-screen { + padding: $space-2; + } + + .theme-header { + padding: $space-3; + } + + .theme-sidebar, + .theme-main { + padding: $space-3; + } +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.ts b/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.ts new file mode 100644 index 0000000..bcc5e20 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/modules/main/theme-customization/theme-customization.component.ts @@ -0,0 +1,246 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ThemeService, Theme } from '../../../services/theme.service'; +import { Subscription } from 'rxjs'; + +@Component({ + selector: 'app-theme-customization', + templateUrl: './theme-customization.component.html', + styleUrls: ['./theme-customization.component.scss'] +}) +export class ThemeCustomizationComponent implements OnInit, OnDestroy { + themes: Theme[] = []; + currentTheme: Theme | null = null; + customTheme: Partial = { + colors: { + primary: '#0ea5e9', + secondary: '#64748b', + accent: '#8b5cf6', + background: '#f8fafc', + surface: '#ffffff', + text: '#111827', + textSecondary: '#6b7280' + }, + fonts: { + primary: 'Inter', + secondary: 'Poppins', + mono: 'JetBrains Mono' + }, + borderRadius: '0.75rem', + shadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)' + }; + isCustomizing = false; + showAdvanced = false; + + private themeSubscription: Subscription = new Subscription(); + + // Color presets and font options from service + colorPresets = this.themeService.getColorPresets(); + fontOptions = this.themeService.getFontOptions(); + + constructor(private themeService: ThemeService) {} + + ngOnInit(): void { + this.themes = this.themeService.getThemes(); + this.currentTheme = this.themeService.getCurrentTheme(); + + this.themeSubscription = this.themeService.currentTheme$.subscribe(theme => { + this.currentTheme = theme; + }); + + this.initializeCustomTheme(); + } + + ngOnDestroy(): void { + this.themeSubscription.unsubscribe(); + } + + selectTheme(themeId: string): void { + this.themeService.selectTheme(themeId); + this.isCustomizing = false; + } + + startCustomizing(): void { + this.isCustomizing = true; + this.initializeCustomTheme(); + } + + cancelCustomizing(): void { + this.isCustomizing = false; + this.initializeCustomTheme(); + } + + applyCustomTheme(): void { + if (this.customTheme.colors && this.customTheme.fonts) { + const customTheme: Theme = { + id: 'custom', + name: 'Custom Theme', + colors: this.customTheme.colors, + fonts: this.customTheme.fonts, + borderRadius: this.customTheme.borderRadius || '0.5rem', + shadow: this.customTheme.shadow || '0 10px 15px -3px rgba(0, 0, 0, 0.1)' + }; + this.themeService.applyTheme(customTheme); + } + this.isCustomizing = false; + } + + resetToDefault(): void { + this.themeService.resetToDefault(); + } + + exportTheme(): void { + const themeJson = this.themeService.exportTheme(); + this.downloadFile(themeJson, 'theme.json', 'application/json'); + } + + importTheme(event: any): void { + const file = event.target.files[0]; + if (file) { + const reader = new FileReader(); + reader.onload = (e) => { + const content = e.target?.result as string; + if (this.themeService.importTheme(content)) { + alert('Theme imported successfully!'); + } else { + alert('Failed to import theme. Please check the file format.'); + } + }; + reader.readAsText(file); + } + } + + private initializeCustomTheme(): void { + if (this.currentTheme) { + this.customTheme = { + colors: { + primary: this.currentTheme.colors.primary, + secondary: this.currentTheme.colors.secondary, + accent: this.currentTheme.colors.accent, + background: this.currentTheme.colors.background, + surface: this.currentTheme.colors.surface, + text: this.currentTheme.colors.text, + textSecondary: this.currentTheme.colors.textSecondary + }, + fonts: { + primary: this.currentTheme.fonts.primary, + secondary: this.currentTheme.fonts.secondary, + mono: this.currentTheme.fonts.mono + }, + borderRadius: this.currentTheme.borderRadius, + shadow: this.currentTheme.shadow + }; + } else { + // Default values if no current theme + this.customTheme = { + colors: { + primary: '#0ea5e9', + secondary: '#64748b', + accent: '#8b5cf6', + background: '#f8fafc', + surface: '#ffffff', + text: '#111827', + textSecondary: '#6b7280' + }, + fonts: { + primary: 'Inter', + secondary: 'Poppins', + mono: 'JetBrains Mono' + }, + borderRadius: '0.75rem', + shadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)' + }; + } + } + + private downloadFile(content: string, filename: string, contentType: string): void { + const blob = new Blob([content], { type: contentType }); + const url = window.URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = filename; + link.click(); + window.URL.revokeObjectURL(url); + } + + // Color picker methods + onColorChange(colorType: string, value: string): void { + if (!this.customTheme.colors) { + this.customTheme.colors = { + primary: '#0ea5e9', + secondary: '#64748b', + accent: '#8b5cf6', + background: '#f8fafc', + surface: '#ffffff', + text: '#111827', + textSecondary: '#6b7280' + }; + } + (this.customTheme.colors as any)[colorType] = value; + } + + // Font picker methods + onFontChange(fontType: string, value: string): void { + if (!this.customTheme.fonts) { + this.customTheme.fonts = { + primary: 'Inter', + secondary: 'Poppins', + mono: 'JetBrains Mono' + }; + } + (this.customTheme.fonts as any)[fontType] = value; + } + + // Border radius methods + onBorderRadiusChange(value: string): void { + this.customTheme.borderRadius = value; + } + + // Shadow methods + onShadowChange(value: string): void { + this.customTheme.shadow = value; + } + + // Preview methods + previewTheme(): void { + if (this.isCustomizing && this.customTheme.colors && this.customTheme.fonts) { + const previewTheme: Theme = { + id: 'preview', + name: 'Preview Theme', + colors: this.customTheme.colors, + fonts: this.customTheme.fonts, + borderRadius: this.customTheme.borderRadius || '0.5rem', + shadow: this.customTheme.shadow || '0 10px 15px -3px rgba(0, 0, 0, 0.1)' + }; + this.themeService.applyTheme(previewTheme); + } + } + + // Utility methods + getColorValue(colorType: string): string { + if (this.customTheme.colors) { + return (this.customTheme.colors as any)[colorType] || '#0ea5e9'; + } + return '#0ea5e9'; + } + + getFontValue(fontType: string): string { + if (this.customTheme.fonts) { + return (this.customTheme.fonts as any)[fontType] || 'Inter'; + } + return 'Inter'; + } + + getBorderRadiusValue(): string { + return this.customTheme.borderRadius || '0.75rem'; + } + + getShadowValue(): string { + return this.customTheme.shadow || '0 10px 15px -3px rgba(0, 0, 0, 0.1)'; + } + + getShadowValueNumber(): string { + const shadowValue = this.getShadowValue(); + const match = shadowValue.match(/\d+/); + return match ? match[0] : '10'; + } +} diff --git a/frontend/angular-clarity-master/src/app/pipes/helpers.module.ts b/frontend/angular-clarity-master/src/app/pipes/helpers.module.ts new file mode 100644 index 0000000..8020056 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/pipes/helpers.module.ts @@ -0,0 +1,31 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ThaiDateAbbrPipe } from './thai-date-abbr.pipe'; +import { ThaiDateFullPipe } from './thai-date-full.pipe'; +import { ThaiDatePipe } from './thai-date.pipe'; +import {TimePipePipe} from './time-pipe.pipe'; +import { SearchFilterPipe } from './search-filter.pipe'; +import { RemoveCommasPipe } from './remove-commas.pipe'; + +@NgModule({ + imports: [ + CommonModule + ], + declarations: [ + ThaiDatePipe, + ThaiDateAbbrPipe, + ThaiDateFullPipe, + TimePipePipe, + SearchFilterPipe, + RemoveCommasPipe, + ], + exports: [ + ThaiDatePipe, + ThaiDateAbbrPipe, + ThaiDateFullPipe, + TimePipePipe, + SearchFilterPipe, + RemoveCommasPipe, + ] +}) +export class HelperModule { } diff --git a/frontend/angular-clarity-master/src/app/pipes/remove-commas.pipe.ts b/frontend/angular-clarity-master/src/app/pipes/remove-commas.pipe.ts new file mode 100644 index 0000000..f5919ff --- /dev/null +++ b/frontend/angular-clarity-master/src/app/pipes/remove-commas.pipe.ts @@ -0,0 +1,8 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ name: 'removeCommas' }) +export class RemoveCommasPipe implements PipeTransform { + transform(value: any): any { + return value?.replace(/,/g, ''); + } +} diff --git a/frontend/angular-clarity-master/src/app/pipes/sanitize.pipe.ts b/frontend/angular-clarity-master/src/app/pipes/sanitize.pipe.ts new file mode 100644 index 0000000..fb2f439 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/pipes/sanitize.pipe.ts @@ -0,0 +1,10 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'sanitize' +}) +export class SanitizePipe implements PipeTransform { + transform(value: string): string { + return value.replace(/<|>/g, ''); + } +} diff --git a/frontend/angular-clarity-master/src/app/pipes/search-filter.pipe.ts b/frontend/angular-clarity-master/src/app/pipes/search-filter.pipe.ts new file mode 100644 index 0000000..b8a781a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/pipes/search-filter.pipe.ts @@ -0,0 +1,58 @@ +import { Pipe, PipeTransform, Injectable } from "@angular/core"; + +@Pipe({ + name: 'filter', + pure: false +}) +@Injectable() +export class SearchFilterPipe implements PipeTransform { + + /** + * @param items object from array + * @param term term's search + * @param excludes array of strings which will ignored during search + */ + transform(items: any, term: string, excludes: any = []): any { + if (!term || !items) return items; + + return SearchFilterPipe.filter(items, term, excludes); + } + + /** + * + * @param items List of items to filter + * @param term a string term to compare with every property of the list + * @param excludes List of keys which will be ignored during search + * + */ + static filter(items: Array<{ [key: string]: any }>, term: string, excludes: any): Array<{ [key: string]: any }> { + + const toCompare = term.toLowerCase(); + + function checkInside(item: any, term: string) { + + if (typeof item === "string" && item.toString().toLowerCase().includes(toCompare)) { + return true; + } + + for (let property in item) { + if (item[property] === null || item[property] == undefined || excludes.includes(property)) { + continue; + } + if (typeof item[property] === 'object') { + if (checkInside(item[property], term)) { + return true; + } + } + else if (item[property].toString().toLowerCase().includes(toCompare)) { + return true; + } + } + return false; + } + + return items.filter(function (item) { + return checkInside(item, term); + }); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/pipes/thai-date-abbr.pipe.ts b/frontend/angular-clarity-master/src/app/pipes/thai-date-abbr.pipe.ts new file mode 100644 index 0000000..c46d2c8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/pipes/thai-date-abbr.pipe.ts @@ -0,0 +1,20 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import * as moment from 'moment'; + +@Pipe({ + name: 'thaiDateAbbr' +}) +export class ThaiDateAbbrPipe implements PipeTransform { + thMonthAbbr = ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', + 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.']; + + transform(value: any, args?: any): any { + if (moment(value, 'YYYY-MM-DD').isValid()) { + const thaiDate = `${moment(value).get('date')} ${this.thMonthAbbr[moment(value).get('month')]} ${moment(value).get('year') + 543}`; + return thaiDate; + } else { + return '-'; + } + } + +} diff --git a/frontend/angular-clarity-master/src/app/pipes/thai-date-full.pipe.ts b/frontend/angular-clarity-master/src/app/pipes/thai-date-full.pipe.ts new file mode 100644 index 0000000..962b135 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/pipes/thai-date-full.pipe.ts @@ -0,0 +1,20 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import * as moment from 'moment'; + +@Pipe({ + name: 'thaiDateFull' +}) +export class ThaiDateFullPipe implements PipeTransform { + thMonth = ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', + 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม']; + + transform(value: any, args?: any): any { + if (moment(value, 'YYYY-MM-DD').isValid()) { + const thaiDate = `${moment(value).get('date')} ${this.thMonth[moment(value).get('month')]} ${moment(value).get('year') + 543}`; + return thaiDate; + } else { + return '-'; + } + } + +} diff --git a/frontend/angular-clarity-master/src/app/pipes/thai-date.pipe.ts b/frontend/angular-clarity-master/src/app/pipes/thai-date.pipe.ts new file mode 100644 index 0000000..52d3a29 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/pipes/thai-date.pipe.ts @@ -0,0 +1,17 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import * as moment from 'moment'; + +@Pipe({ + name: 'thaiDate' +}) +export class ThaiDatePipe implements PipeTransform { + transform(value: any, args?: any): any { + if (moment(value, 'YYYY-MM-DD').isValid()) { + const thaiDate = `${moment(value).get('date')}/${moment(value).get('month') + 1}/${moment(value).get('year') + 543}`; + return thaiDate; + } else { + return '-'; + } + } + +} diff --git a/frontend/angular-clarity-master/src/app/pipes/time-pipe.pipe.ts b/frontend/angular-clarity-master/src/app/pipes/time-pipe.pipe.ts new file mode 100644 index 0000000..daa03b8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/pipes/time-pipe.pipe.ts @@ -0,0 +1,36 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'timePipe', + pure: true +}) +export class TimePipePipe implements PipeTransform { + + transform(value: any, args?: any): any { + if (value) { + const seconds = Math.floor((+new Date() - +new Date(value)) / 1000); + if (seconds < 29) // less than 30 seconds ago will show as 'Just now' + return 'Just now'; + const intervals: { [key: string]: number } = { + 'year': 31536000, + 'month': 2592000, + 'week': 604800, + 'day': 86400, + 'hour': 3600, + 'minute': 60, + 'second': 1 + }; + let counter; + for (const i in intervals) { + counter = Math.floor(seconds / intervals[i]); + if (counter > 0) + if (counter === 1) { + return counter + ' ' + i + ' ago'; // singular (1 day ago) + } else { + return counter + ' ' + i + 's ago'; // plural (2 days ago) + } + } + } + return value; +} +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/accesstype.service.ts b/frontend/angular-clarity-master/src/app/services/admin/accesstype.service.ts new file mode 100644 index 0000000..4c3029d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/accesstype.service.ts @@ -0,0 +1,64 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class AccesstypeService { + private AllURL = 'access_type/Accesstype'; +private moduleurl='_back/Modules_t' + constructor( private apiRequest: ApiRequestService,private _http: HttpClient,) { } + getAll(page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + return this.apiRequest.get(this.AllURL, params); + } + + create(data:any): Observable { + return this.apiRequest.post(this.AllURL, data); + } + + delete(id: number): Observable { + const _http = this.AllURL + "/" + id; + return this.apiRequest.delete(_http); + } + + update(id: number, data: any): Observable { + const _http = this.AllURL + "/" + id; + return this.apiRequest.put(_http, data); + } + getAll1(page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + return this.apiRequest.get(this.moduleurl, params); + } + + create1(data:any): Observable { + return this.apiRequest.post(this.moduleurl, data); + } + + delete1(id: number): Observable { + const _http = this.moduleurl + "/" + id; + return this.apiRequest.delete(_http); + } + + update1(id: number, data: any): Observable { + const _http = this.moduleurl + "/" + id; + return this.apiRequest.put(_http, data); + } + public getById(id: any){ + return this._http.get(`${baseUrl}/access_type/accessmenu/Accessmenu/${id}`); + } + public addById(id:any,data:any){ + return this._http.post(`${baseUrl}/access_type/accessmenu/Accessmenu/${id}`,data); + + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/auditreport.service.ts b/frontend/angular-clarity-master/src/app/services/admin/auditreport.service.ts new file mode 100644 index 0000000..ea0066b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/auditreport.service.ts @@ -0,0 +1,38 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from 'src/app/services/api/helper'; +import { ApiRequestService } from '../api/api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class AuditreportService { +private dateurl="audit/betweendate"; + constructor(private _http: HttpClient,private apiRequest: ApiRequestService,) { } + public getAll() { + return this._http.get(`${baseUrl}/audit/auditall`); + } + public getbyid(id:any) { + return this._http.get(`${baseUrl}/audit/auditall/${id}`); + } + public getbyuser(val:any){ + return this._http.get(`${baseUrl}/audit/listusername/${val}`); + } + public getbyentity(val:any){ + return this._http.get(`${baseUrl}/audit/listentityname/${val}`); + } + public onlydate(from:any,to:any){ + let params: HttpParams = new HttpParams(); + params =params.append("startDate",from); + params =params.append("endDate",to); + return this.apiRequest.get(this.dateurl,params); + } + public apply(from:any,to:any,user:any,entity:any){ + let params: HttpParams = new HttpParams(); + params =params.append("startDate",from); + params =params.append("endDate",to); + params =params.append("user",user); + params =params.append("entity_name",entity) + return this.apiRequest.get(`audit/betweendate_byuser`,params); + //return this._http.get(`${baseUrl}/audit/betweendate_byuser/${from}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/connector-mapping.service.ts b/frontend/angular-clarity-master/src/app/services/admin/connector-mapping.service.ts new file mode 100644 index 0000000..4a8b75a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/connector-mapping.service.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core'; +import baseUrl from 'src/app/services/api/helper'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import { ApiRequestService } from '../api/api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class ConnectorMappingService { + private getAllData = 'connector/Connectorjson'; + private baseURL = 'Connectorjson'; + + constructor(private _http: HttpClient,) { } + public getAll() { + return this._http.get(`${baseUrl}/connector/Connectorjson`); + } + public create(data: any){ + return this._http.post(`${baseUrl}/connector/Connectorjson`, data); + } + public getById(id: any){ + return this._http.get(`${baseUrl}/connector/Connectorjson/${id}`); + } + public delete(id:any){ + return this._http.delete(`${baseUrl}/connector/Connectorjson/${id}`); + } + public getkeys(data:any) { + return this._http.post(`${baseUrl}/token/connector/mapping/mapping`,data); + } + public getValues(data:any) { + return this._http.post(`${baseUrl}/token/connector/mapping/mapping1`,data); + } + public getValues1(data:any) { + return this._http.post(`${baseUrl}/token/connector/mapping/mapping2`,data); + } + public update(id:any,data:any){ + return this._http.put(`${baseUrl}/connector/Connectorjson/${id}`, data); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/deploymentprofile.service.ts b/frontend/angular-clarity-master/src/app/services/admin/deploymentprofile.service.ts new file mode 100644 index 0000000..44f776b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/deploymentprofile.service.ts @@ -0,0 +1,47 @@ +import { Injectable } from '@angular/core'; +import { ApiRequestService } from '../api/api-request.service'; +import { HttpClient, HttpHeaders, HttpParams } from "@angular/common/http"; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class DeploymentprofileService { + + private getAllURL = 'deployment/deplomentprofile'; + addDataURl = 'deployment/deplomentprofile'; + private baseURL = "deployment/deplomentprofile"; + private getallline="deployment/deplomentprofile_line"; + constructor( + private _http: HttpClient, + private apiRequest: ApiRequestService + ) { } + + getAll(page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + return this.apiRequest.get(this.getAllURL, params); + } +getalllines(page?: number, size?: number){ + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + return this.apiRequest.get(this.getallline,params); +} + create(data:any): Observable { + return this.apiRequest.post(this.addDataURl, data); + } + + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/health-checkup.service.ts b/frontend/angular-clarity-master/src/app/services/admin/health-checkup.service.ts new file mode 100644 index 0000000..6ceb797 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/health-checkup.service.ts @@ -0,0 +1,74 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import{environment} from 'src/environments/environment'; +import { ApiRequestService } from '../api/api-request.service'; +import { HealthCheckup } from 'src/app/models/fnd/health_checkup'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class HealthCheckupService { + + baseUrl = 'HealthCheckup' + constructor(private _http: HttpClient, + private apiRequest: ApiRequestService) { } + + getHealthCheckups(): Observable { + return this.apiRequest.get(`${this.baseUrl}/HealthCheckup`); + } + + getHealthCheckupById(id: number): Observable { + return this.apiRequest.get(`${this.baseUrl}/HealthCheckup/${id}`); + } + + saveHealthCheckup(data: string, files: File[]): Observable { + const formData: FormData = new FormData(); + formData.append('data', JSON.stringify(data)); + + if (files && files.length > 0) { + // console.log("if Condition",files); + // for (const file of files) { + // console.log("if Condition",file); + // formData.append('files', file, file.name); + // } + for (let i = 0; i < files.length; i++) { + formData.append('files', files[i]); + console.log("if Condition",files[i]); + } + } + + return this.apiRequest.postFormData(`${this.baseUrl}/HealthCheckup`, formData); + } + + updateHealthCheckup(id: number, data: HealthCheckup): Observable { + return this.apiRequest.put(`${this.baseUrl}/HealthCheckup/${id}`, data); + } + + deleteHealthCheckup(id: number): Observable { + return this.apiRequest.delete(`${this.baseUrl}/HealthCheckup/${id}`); + } + + //redeploy + public getFileContent(healthId: number): Observable { + console.log(healthId) + const url = `HealthCheckupfile/readeploy/${healthId}`; + return this.apiRequest.get(url); + } + + //files + + getAllHealthCheckupFiles(healthId: number): Observable { + return this.apiRequest.get(`HealthCheckupfile/HealthCheckupfile/${healthId}`); + } + + readFile(fileId: number): Observable { + return this.apiRequest.get(`HealthCheckupfile/readfile/${fileId}`); + } + +//checkup + getHealthCheckup(jobtype: string): Observable { + const url = `${this.baseUrl}/healthcheckup?jobtype=${jobtype}`; + return this.apiRequest.get(url); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/logconfig.service.ts b/frontend/angular-clarity-master/src/app/services/admin/logconfig.service.ts new file mode 100644 index 0000000..0fa8786 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/logconfig.service.ts @@ -0,0 +1,28 @@ +import { Injectable } from '@angular/core'; +import baseUrl from 'src/app/services/api/helper'; +import { HttpClient } from '@angular/common/http'; +@Injectable({ + providedIn: 'root' +}) +export class LogconfigService { + + constructor(private _http: HttpClient,) { } + public getAll() { + return this._http.get(`${baseUrl}/log/getAll`); + } + public getbyid(Id: any){ + return this._http.get(`${baseUrl}/log/getOne/${Id}`); + } + public create(username:any,mode:any){ + return this._http.get(`${baseUrl}/log/startLogging/${username}/${mode}`); + } + public delete(username:any){ + return this._http.get(`${baseUrl}/log/stopLogging/${username}`); + } + public downloadfile(filename:any){ + return this._http.get(`${baseUrl}/log/downloadLog/${filename}`); + } + public readfile(id:any){ + return this._http.get(`${baseUrl}/log2/fileread/${id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/menu-group.service.ts b/frontend/angular-clarity-master/src/app/services/admin/menu-group.service.ts new file mode 100644 index 0000000..e1e1865 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/menu-group.service.ts @@ -0,0 +1,76 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from '../../services/api/helper'; +import { ApiRequestService } from '../api/api-request.service'; +import { Rn_Main_Menu } from '../../models/builder/Rn_Main_Menu'; +import { Observable } from 'rxjs'; +import { CookieService } from 'ngx-cookie-service'; +@Injectable({ + providedIn: 'root' +}) +export class MenuGroupService { + public key: string ='key-for-data-in-cookies'; + private storage: Storage = sessionStorage; + constructor( + private _http: HttpClient,private readonly _cookieService: CookieService, + private apiRequest: ApiRequestService, + ) { } + + public getAll(){ + return this._http.get(`${baseUrl}/api/menu-group`); + } + + public addToDb(header: any){ + return this._http.post(`${baseUrl}/api/menu-group`, header); + } + + public addLineToDb(line: any){ + return this._http.post(`${baseUrl}/lines_m/create`, line); + } + + public getOneById(id: any){ + return this._http.get(`${baseUrl}/api/menu-group/${id}`); + } + + public updateGroupHeader(id: any, data: any){ + return this._http.put(`${baseUrl}/api/menu-group/${id}`, data); + } + + public updateLineById(id: any){ + return this._http.put(`${baseUrl}/lines_m/update`, id); + } + + public deleteById(id: any){ + return this._http.delete(`${baseUrl}/api/menu-group/${id}`); + } + getByCurrentUserMenuGroupId(): Observable { + const _http1 = "api1/getByUserId" + return this.apiRequest.get(_http1); +} +getByCurrentUserMenuGroupId1(): Observable { + const _http1 = "api1/submenu1" + return this.apiRequest.get(_http1); +} +getByCurrentUserMenuGroupId2(): Observable { + const _http1 = "fndMenu/menuloadbyuser"//9292/fndMenu/menuloadbyuser + return this.apiRequest.get(_http1); +} +private data: string = "data"; +public storeaddeditvalues(data:any,) { + this.storage.setItem(this.data,JSON.stringify (data)); + console.log(this.data); +} +getdata(): any { + //console.log(this.data); + var data = JSON.parse(this.storage.getItem(this.data)); + //let data = this.storage.getItem(this.data); + return data; +} +getuser(id:any){ + const http="chat/getuser"; + return this.apiRequest.post(http,id); +} +public save(text:string):void{ + return this._cookieService.set(this.key,text); +} +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/menu-register.service.ts b/frontend/angular-clarity-master/src/app/services/admin/menu-register.service.ts new file mode 100644 index 0000000..82ed7d1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/menu-register.service.ts @@ -0,0 +1,33 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from '../../services/api/helper'; + +@Injectable({ + providedIn: 'root' +}) +export class MenuRegisterService { + + constructor( + private _http: HttpClient + ) { } + + public add(r: any){ + return this._http.post(`${baseUrl}/api/menu-register`, r); + } + + public getd(){ + return this._http.get(`${baseUrl}/api/menu-register`); + } + + public getById(id: any){ + return this._http.get(`${baseUrl}/api/menu-register/${id}`); + } + + public update(id:any, reg:any){ + return this._http.put(`${baseUrl}/api/menu-register/${id}`, reg); + } + + public deleteById(id: any){ + return this._http.delete(`${baseUrl}/api/menu-register/${id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/menumaintance.service.ts b/frontend/angular-clarity-master/src/app/services/admin/menumaintance.service.ts new file mode 100644 index 0000000..c407dce --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/menumaintance.service.ts @@ -0,0 +1,69 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import baseUrl from '../../services/api/helper'; +import { Observable } from "rxjs"; +import { Rn_Main_Menu } from "../../models/builder/Rn_Main_Menu"; +import { ApiRequestService } from '../api/api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class MenumaintanceService { + + constructor(private _http: HttpClient, + private apiRequest: ApiRequestService,) { } + // create + public create(data: any){ + return this._http.post(`${baseUrl}/Menu_maintain`, data); + } + + // update + public update(id:number,data:any): Observable{ + //const _http = this.baseURL + "/" + id; + //return this.apiRequest.put(_http, data); + return this._http.put(`${baseUrl}/Menu_maintain/${id}`, data); + } + // get all + public getAll(){ + return this._http.get(`${baseUrl}/Menu_maintain`); + } + getByCurrentUserMenuGroupId1(): Observable { + const _http1 = "api1/submenu1" + return this.apiRequest.get(_http1); + } + // add submenudet table + // create + public create1(data: any){ + return this._http.post(`${baseUrl}/api1/Sec_menuDet`, data); + } + public create2(data:any){ + return this._http.post(`${baseUrl}/api1/addgrpwithsubmenu`, data) + } + // sink + public sink(id:any,data:any){ + return this._http.put(`${baseUrl}/fndMenu/sink/${id}`,data); + } + //get by menuid->submenu + public getbyid(id:any){ + return this._http.get(`${baseUrl}/api1/submenu1/${id}`); + } + //update update by menu_item_id + public update1(id:number,data:any): Observable{ + return this._http.put(`${baseUrl}/api1/submenu1/${id}`, data); + } + public update2(id:number,usrgrp:any,data:any): Observable{ + return this._http.put(`${baseUrl}/api1/update/${id}/${usrgrp}`, data); +} + //delete + public delete1(id: any){ + return this._http.delete(`${baseUrl}/api1/menu/${id}`); + } + // get one + public getOne(Id: any){ + return this._http.get(`${baseUrl}/Menu_maintain/${Id}`); + } + + // delete + public delete(id: any){ + return this._http.delete(`${baseUrl}/Menu_maintain/${id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/myworkspace.service.ts b/frontend/angular-clarity-master/src/app/services/admin/myworkspace.service.ts new file mode 100644 index 0000000..02f6a8b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/myworkspace.service.ts @@ -0,0 +1,98 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import baseUrl from '../../services/api/helper'; + +@Injectable({ + providedIn: 'root' +}) +export class MyworkspaceService { + public localStorage: Storage = localStorage; + constructor(private _http: HttpClient) { } + public add(r: any){ + return this._http.post(`${baseUrl}/api/menu-register`, r); + } + + public getall(){ + return this._http.get(`${baseUrl}/Workspace_team/SecTeam`); + } + public getalluser(){ + return this._http.get(`${baseUrl}/User_workSpace/GetAllUser`); + } + public getallguest(){ + return this._http.get(`${baseUrl}/User_workSpace/GetAllGuest`); + } + public adduser(email:any){ + let params: HttpParams = new HttpParams(); + params = params.append("email", email); + return this._http.post(`${baseUrl}/api/userviaadmin`,params); + } + storeEmail(email: string) { + this.localStorage.setItem("registeredEmail", email); + } + //Store userinfo from session storage + + //Get email from session storage ( WILL REMOVE AFTER REGISTER) + getStoredEmail(): string | null { + try { + let email: string = this.localStorage.getItem( + "registeredEmail" + ); + if (email) { + return email; + } else { + return null; + } + } catch (e) { + return null; + } + } + adduserdetails(data:any,token:any){ + return this._http.post(`${baseUrl}/api/admin/adduser/${token}`,data); + } + + addguest(email:any,duration:any){ + let params: HttpParams = new HttpParams(); + params = params.append("email", email); + params=params.append("access_duration",duration) + return this._http.post(`${baseUrl}/api/guest_via_admin`,params); + } + + addguestdetails(data:any,token:any){ + return this._http.post(`${baseUrl}/api/admin/addguest/${token}`,data); + } + addteam(data:any){ + return this._http.post(`${baseUrl}/Workspace_team/SecTeam`,data); + } + public getallteammeme(id:any){ + return this._http.get(`${baseUrl}/User_workSpace/GetAllMember/${id}`); + } + getallusertosameaccid(){ + return this._http.get(`${baseUrl}/User_workSpace/GetAll`); + } + addteammem(id:any,user_id:any,data:any){ + return this._http.post(`${baseUrl}/User_workSpace/add_team/${id}/${user_id}`,data); + } + getallworkspace(){ + return this._http.get(`${baseUrl}/Workspace_workspace/FindByaccount`); + } + addsecworkspaceuser(usrid:any,id:any,data:any,){ + return this._http.post(`${baseUrl}/workspace/secworkspaceuser/add_workspace/users/${usrid}/${id}`,data); + } + addsecworkteam(pid:any,tid:any,data:any){ + return this._http.post(`${baseUrl}/workspace/secworkspaceuser/addteam/${pid}/${tid}`,data); + } + getallsecworkspace(id:any){ + return this._http.get(`${baseUrl}/workspace/secworkspaceuser/get_by_projectid/${id}`); + } + // public getById(id: any){ + // return this._http.get(`${baseUrl}/api/menu-register/${id}`); + // } + + // public update(id:any, reg:any){ + // return this._http.put(`${baseUrl}/api/menu-register/${id}`, reg); + // } + + // public deleteById(id: any){ + // return this._http.delete(`${baseUrl}/api/menu-register/${id}`); + // } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/outgoingwebhook.service.ts b/frontend/angular-clarity-master/src/app/services/admin/outgoingwebhook.service.ts new file mode 100644 index 0000000..16d441f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/outgoingwebhook.service.ts @@ -0,0 +1,51 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; + +@Injectable({ + providedIn: 'root' +}) +export class OutgoingwebhookService { + + constructor(private apiRequest: ApiRequestService) { } + getall(){ + let _http = `api/outgoing/getall`; + return this.apiRequest.get(_http); + } + getallentity(){ + let _http = `api/outgoing/getentity`; + return this.apiRequest.get(_http); + } + wall(){ + let _http = `api/webhookdata/getall`; + return this.apiRequest.get(_http); + } + post(data:any){ + let _http=`api/outgoing/save`; + return this.apiRequest.post(_http,data); + } + getById(id: number) { + const _http =`api/outgoing/getById/${id}`; + return this.apiRequest.get(_http); + } + update(id: number, data:any): Observable { + const _http =`api/outgoing/update/${id}`; + return this.apiRequest.put(_http,data); + } + update1(id: number, data:any): Observable { + const _http =`api/outgoing_lines/update/${id}`; + return this.apiRequest.put(_http,data); + } + delete(id:any){ + let _http=`api/outgoing/delete/${id}`; + return this.apiRequest.delete(_http,); + } + getallworkflow(){ + let _http = `token/webhook/Workflow/getall`; + return this.apiRequest.get(_http); + } + getbyidworkflow(id:any){ + let _http = `token/webhook/Workflow/get/${id}`; + return this.apiRequest.get(_http); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/sessionlogger.service.ts b/frontend/angular-clarity-master/src/app/services/admin/sessionlogger.service.ts new file mode 100644 index 0000000..f48fc28 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/sessionlogger.service.ts @@ -0,0 +1,17 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class SessionloggerService { + + constructor(private _http: HttpClient) { } + public getAll() { + return this._http.get(`${baseUrl}/user1/session/getAll`); + } + + public delete(id:any){ + return this._http.delete(`${baseUrl}/user1/session/delete/${id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/sure-connector.service.ts b/frontend/angular-clarity-master/src/app/services/admin/sure-connector.service.ts new file mode 100644 index 0000000..87a3c74 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/sure-connector.service.ts @@ -0,0 +1,25 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +//import baseUrl from 'src/app/services/api/helper'; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class SureConnectorService { + baseurl = environment.jobmgurl; + constructor(private _http: HttpClient,) { } + public getAll() { + return this._http.get(`${this.baseurl}/jobpro/get_rn_sureconnetor`); + } + public create(data: any){ + return this._http.post(`${this.baseurl}/jobpro/Savern_sureconnetor`, data); + } + + public delete(id:any){ + return this._http.delete(`${this.baseurl}/jobpro/delete_by_rn_sureconnetor_id/${id}`); + } + + public update(id:any,data:any){ + return this._http.put(`${this.baseurl}/jobpro/update_rn_sureconnetor/${id}`, data); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/sure-opsscriptmaster.service.ts b/frontend/angular-clarity-master/src/app/services/admin/sure-opsscriptmaster.service.ts new file mode 100644 index 0000000..d0cd824 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/sure-opsscriptmaster.service.ts @@ -0,0 +1,86 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; + +@Injectable({ + providedIn: 'root' +}) +export class SureOpsscriptmasterService { + private URL = 'Sureops_script_api/Sureops_script_apis'; + private url='Sureops_script_api/Sureops_script_line' + private masterurl='Sureops_script_master/sureops_scriptmaster1' + constructor(private _http: HttpClient,private apiRequest: ApiRequestService) { } + getAll(page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + // params = params.append("module_id", module_id.toString()); + // get all + return this.apiRequest.get(this.URL, params); + } + + create(data:any): Observable{ + return this.apiRequest.post(this.URL, data); + } + + delete(id:number){ + let _http = this.URL + "/" + id; + return this.apiRequest.delete(_http); + } + + getById(id:number) + { + let _http = this.URL + "/"+id; + return this.apiRequest.get(_http); + } + + updateLineById(id:number,data:any) + { + let _http = this.url + "/"+id; + return this.apiRequest.put(_http,data); + } + + update(id:number,data:any) + { + let _http = this.URL + "/"+id; + return this.apiRequest.put(_http,data); + } + + getall(page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + // params = params.append("module_id", module_id.toString()); + // get all + return this.apiRequest.get(this.masterurl, params); + } + + create1(data:any): Observable{ + return this.apiRequest.post(this.masterurl, data); + } + + delete1(id:number){ + let _http = this.masterurl + "/" + id; + return this.apiRequest.delete(_http); + } + + getById1(id:number) + { + let _http = this.masterurl + "/"+id; + return this.apiRequest.get(_http); + } + + + + update1(id:number,data:any) + { + let _http = this.masterurl + "/"+id; + return this.apiRequest.put(_http,data); + } + +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/sureapi.service.ts b/frontend/angular-clarity-master/src/app/services/admin/sureapi.service.ts new file mode 100644 index 0000000..9426ec5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/sureapi.service.ts @@ -0,0 +1,23 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from 'src/app/services/api/helper'; +import { ApiRequestService } from '../api/api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class SureapiService { +url='sure_connect/sure_postman/call_api' + constructor(private http:HttpClient,private apiRequest: ApiRequestService,) { } + createpostman(api_url:any,json_body:any,method: any,token:any){ + console.log(api_url,json_body,method,token) + let params: HttpParams = new HttpParams(); + params =params.append("api_url",api_url); + // params =params.append("json_body",json_body); + params =params.append("method",method); + params =params.append("token",token) + return this.http.post(`${baseUrl}/sure_connect/sure_postman/call_api`,json_body,{params:params}); + //return this.apiRequest.post(this.url,{ search:params }); + + + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/sureconnect.service.ts b/frontend/angular-clarity-master/src/app/services/admin/sureconnect.service.ts new file mode 100644 index 0000000..e8b6086 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/sureconnect.service.ts @@ -0,0 +1,35 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import baseUrl from 'src/app/services/api/helper'; +import { ApiRequestService } from '../api/api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class SureconnectService { + + constructor(private _http: HttpClient, + private apiRequest: ApiRequestService,) { } + public create(data: any){ + return this._http.post(`${baseUrl}/Sure_Connect`, data); + } + + // create card + public update(data: any,id:any){ + return this._http.put(`${baseUrl}/Sure_Connect/${id}`, data); + } + + // get all cards + public getAll(){ + return this._http.get(`${baseUrl}/Sure_Connect`); + } + + // get one card + public getOne(id: any){ + return this._http.get(`${baseUrl}/Sure_Connect/${id}`); + } + + // delete card + public delete(id: any){ + return this._http.delete(`${baseUrl}/Sure_Connect/${id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/sysparameter.service.ts b/frontend/angular-clarity-master/src/app/services/admin/sysparameter.service.ts new file mode 100644 index 0000000..b55858a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/sysparameter.service.ts @@ -0,0 +1,33 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { ApiRequestService } from "../api/api-request.service"; +import { HttpParams } from "@angular/common/http"; +import { HttpClient } from '@angular/common/http'; +@Injectable({ + providedIn: 'root' +}) +export class SysparameterService { + private addsysurl = 'sysparam/addSysParams '; + private updatesysurl = 'sysparam/updateSysParams'; + private getbyidurl = 'sysparam/getSysParams'; + constructor(private apiRequest: ApiRequestService,) { } + + + create(data: any): Observable { + return this.apiRequest.post(this.addsysurl, data); + } + + update(id: number, data: any, file: any): Observable { + const s = JSON.stringify(data); + const formData: FormData = new FormData(); + formData.append("o1", s); + formData.append(file.name, file); + + const _http = this.updatesysurl + "/" + id; + return this.apiRequest.put(_http, data); + } + getById(id: number): Observable { + const _http = this.getbyidurl + "/" + id; + return this.apiRequest.get(_http); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/university.service.ts b/frontend/angular-clarity-master/src/app/services/admin/university.service.ts new file mode 100644 index 0000000..1364856 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/university.service.ts @@ -0,0 +1,44 @@ +import { Injectable } from '@angular/core'; +import { HttpParams } from "@angular/common/http"; +import { university } from "../../models/fnd/university"; +import { Observable } from "rxjs"; +import { ApiRequestService } from "../api/api-request.service"; +import { UserInfoService } from "../user-info.service"; + +@Injectable({ + providedIn: 'root' +}) +export class UniversityService { + + private baseURL = "api/author"; + constructor( + private apiRequest: ApiRequestService, + private userInfoService: UserInfoService + ) { } + getAll(page?: number, size?: number): Observable { + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + //const _http = this.baseURL + '/all'; + console.log(this.userInfoService.getUserInfo().userId); + let id = this.userInfoService.getUserInfo().userId; + return this.apiRequest.get(this.baseURL, params); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(college: university): Observable { + return this.apiRequest.post(this.baseURL, college); + } + + update(id: number, projectSetup: university): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, projectSetup); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/user-list.service.ts b/frontend/angular-clarity-master/src/app/services/admin/user-list.service.ts new file mode 100644 index 0000000..aa48719 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/user-list.service.ts @@ -0,0 +1,33 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from '../../services/api/helper'; + +@Injectable({ + providedIn: 'root' +}) +export class UserListService { + + constructor( + private _http: HttpClient + ) { } + + public add(user: any){ + return this._http.post(`${baseUrl}/user_list/create`, user); + } + + public update(user: any){ + return this._http.put(`${baseUrl}/user_list/update`, user); + } + + public getOne(user: any){ + return this._http.get(`${baseUrl}/user_list/get-one/${user}`); + } + + public getAll(){ + return this._http.get(`${baseUrl}/user_list/get-all`); + } + + public deleteById(id: any){ + return this._http.delete(`${baseUrl}/user_list/delete/${id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/user-profile.service.ts b/frontend/angular-clarity-master/src/app/services/admin/user-profile.service.ts new file mode 100644 index 0000000..13160da --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/user-profile.service.ts @@ -0,0 +1,120 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { AppConfig } from '../../app-config'; +import { Observable } from 'rxjs'; +import { UserInfoService } from '../user-info.service'; +import { ApiRequestService } from '../api/api-request.service'; +import { TranslateService } from '../api/translate.service'; +import { environment } from 'src/environments/environment'; + +export interface UserProfile { + email: string; + firstName: string; + lastName: string; + fullName: string; + pronouns?: string; + photos?: string; + status?: string; + role?: string; + roles?: Role[]; + department?: string; + about?: string; + createdAt?: Date; + updatedAt?: Date; + accountId?: number; + createdBy?: number; + updatedBy: number; + +} +export interface Role { + id: number; + name: string; + description: string; +} +@Injectable() +export class UserProfileService { + + private userProfileURL = 'api/user-profile'; + private postUserProfilePicURL = 'api/upload'; + private getUserProfilePicURL = 'api/retrieve-image'; + private userAcountURL = 'api/user-account'; + private aboutWork = 'token/aboutwork'; + + private getids = 'token/userid'; + + private actionBuilderURL="token/aboutwork" + + + constructor( + private apiRequest: ApiRequestService, + private translate: TranslateService, + private userInfoService: UserInfoService, + private http: HttpClient, + private appConfig: AppConfig, + ) { } + + /* getAll(page?:number, size?:number): Observable { + //Create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append('page', typeof page === "number"? page.toString():"0"); + params = params.append('size', typeof size === "number"? size.toString():"1000"); + // get all + // return this.apiRequest.get('api/instructors'); + // paginated data + return this.apiRequest.get(this.baseURL, params); + + } */ + + getUserProfile(): Observable { + const _http = this.userProfileURL; + return this.apiRequest.get(_http); + + } + updateUserProfile(user: UserProfile): Observable { + const _http = this.userProfileURL; + return this.apiRequest.put(_http, user); + } + + uploadUserProfilePic(fileToUpload: File): Observable { + const formData: FormData = new FormData(); + formData.append('imageFile', fileToUpload, fileToUpload?.name); + return this.http.post(this.appConfig.baseApiPath + this.postUserProfilePicURL, formData, { reportProgress: true, observe: 'events' }); + } + + getProfilePic(): Observable { + return this.apiRequest.get(this.getUserProfilePicURL); + } + + + getUserAccountDetails() { + return this.apiRequest.get(this.userAcountURL); + } + + saveUser(data): Observable { + return this.apiRequest.post(this.aboutWork, data); + } + + updateUser(id,data): Observable { + const _http = this.actionBuilderURL + "/" + id; + return this.apiRequest.put(_http, data); + } + + getUser(id: number, checknumber: number): Observable { + return this.apiRequest.get(this.getids + "/" + id + "/" + checknumber); + // return this.apiRequest.get(this.getids, data); + + } + private url = environment.backendUrl +"/token/"; + /////////////// + addUserinSignUP(data:any): Observable { + return this.http.post(`${this.url}users/sysaccount/savesysaccount`, data); + } + + adduserData(data:any): Observable { + return this.http.post(`${this.url}addOneAppUser`, data); + } + + + +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/user-registration.service.ts b/frontend/angular-clarity-master/src/app/services/admin/user-registration.service.ts new file mode 100644 index 0000000..7fe4799 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/user-registration.service.ts @@ -0,0 +1,290 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http"; +import { PasswordResetComponent } from "src/app/modules/main/admin/password-reset/password-reset.component"; + +import { UserRegistrationComponent } from "src/app/modules/main/admin/user-registration/user-registration.component"; +import { Observable } from "rxjs"; +import { UserInfoService } from "../user-info.service"; +import { ApiRequestService } from "../api/api-request.service"; +import { environment } from 'src/environments/environment'; + +export interface User { + firstName: string; + lastName: string; + password: string; + email: string; +} + +export interface Sys_Account { + userEmail: string; + companyName: string; + workspace: string; + gstNumber: string; +} + +export interface SignedUpUser { + userId: string; + email: string; + fullName: string; + firstName: string; +} +export interface signUpInfo { + success?: boolean; + message?: string; + landingPage?: string; + user?: SignedUpUser; +} + + +@Injectable({ + providedIn: 'root' +}) +export class UserRegistrationService { + + private baseURL = "api/user-registration"; // still not in use + private emailExistURL = "token/email-exists"; // email exist check + private userRegURL = "token/user-registration"; + private companyRegURL = "token/company-registration"; + private resetPasswordURL = "api/reset_password"; + + public registeredEmailKey: string = "registeredEmail"; + public localStorage: Storage = localStorage; + public sessionStorage: Storage = sessionStorage; + + private url = environment.backendUrl +"/token/"; + + + constructor(private apiRequest: ApiRequestService,private http:HttpClient, + private userInfoService: UserInfoService) { } + + /* takenUsernames: any[] = []; + checkIfUsernameExists(username: string): Observable { + return of(this.takenUsernames.includes(username)) + .pipe(delay(1000)); + } + usernameValidator(): AsyncValidatorFn { + return (control: AbstractControl): Observable => { + return this.checkIfUsernameExists(control.value).pipe( + map(res => { + // if res is true, username exists, return true + return res ? { usernameExists: true } : null; + // NB: Return null if there is no error + }) + ); + }; + } */ + + //Store userinfo from session storage + storeEmail(userInfoString: string) { + this.localStorage.setItem(this.registeredEmailKey, userInfoString); + } + + //Remove userinfo from session storage + removeStoredEmail() { + this.localStorage.removeItem(this.registeredEmailKey); + } + + //Get email from session storage ( WILL REMOVE AFTER REGISTER) + getStoredEmail(): string | null { + try { + let userInfoString: string = this.localStorage.getItem( + this.registeredEmailKey + ); + if (userInfoString) { + return userInfoString; + } else { + return null; + } + } catch (e) { + return null; + } + } + + /* === store signed up user info in storage === */ + public registeredUserKey: string = "registeredUser"; + storeSignedUpUserInfo(userInfoString: string) { + this.sessionStorage.setItem(this.registeredUserKey, userInfoString); + } + removeSignedUpUserInfo() { + this.sessionStorage.removeItem(this.registeredUserKey); + } + + //Get userinfo from session storage + getSignedUpUserInfo(): SignedUpUser | null { + try { + let userInfoString: string = this.sessionStorage.getItem( + this.registeredUserKey + ); + if (userInfoString) { + let userObj: SignedUpUser = JSON.parse( + this.sessionStorage.getItem(this.registeredUserKey) + ); + return userObj; + } else { + return null; + } + } catch (e) { + return null; + } + } + // Get Full Name from session storage + getFirstName(): string { + let userObj: SignedUpUser = this.getSignedUpUserInfo(); + if (userObj !== null) { + //console.log('getFirstName() : ', userObj.firstName); + return userObj.firstName; + } + return "no-user"; + } + // Get User Email from session storage + getEmail(): string { + let userObj: SignedUpUser = this.getSignedUpUserInfo(); + if (userObj !== null) { + //console.log('getEmail() : ', userObj.email); + return userObj.email; + } + return "no-user"; + } + // Get User Id from session storage + getUserId(): string { + let userObj: SignedUpUser = this.getSignedUpUserInfo(); + if (userObj !== null) { + return userObj.userId; + } + return "no-user"; + } + + /* === store signed up user info in storage END === */ + + /* === check if email is aailable or not === */ + emailCheck(email: UserRegistrationComponent): Observable { + return this.apiRequest.post(this.emailExistURL, email); + } + /* === signed up user (admin) === */ + + /* public landingPage:string = "/account-setup"; + saveUser(user: User): Observable { + let signupDataSubject: BehaviorSubject = new BehaviorSubject([]); + let signupInfoReturn: signUpInfo; + this.apiRequest.post(this.userRegURL, user).subscribe( + (res) => { + if ( + res !== undefined && + res !== null && + res.operationStatus === "SUCCESS" + ) { + signupInfoReturn = { + success: true, + message: res.operationMessage, + landingPage: this.landingPage, + user: { + userId: res.item.userId, + email: res.item.email, + fullName: res.item.fullname, + firstName: res.item.firstName, + }, + }; + console.log('signupInfoReturn : ', signupInfoReturn); + // store signed up user info in session storage for further case + this.storeSignedUpUserInfo(JSON.stringify(signupInfoReturn.user)); + } else { + //Create a faliure object that we want to send back to login page + signupInfoReturn = { + success: false, + message: res.operationMessage, + landingPage: "/create-account", + }; + } + signupDataSubject.next(signupInfoReturn); + }, + (err) => { + console.log("signup error ", err); + signupInfoReturn = { + success: false, + message: err.url + " >>> " + err.statusText + "[" + err.status + "]", + landingPage: "/create-account", + }; + } + ); + console.log('signupDataSubject : ', signupDataSubject); + + return signupDataSubject; + //return this.apiRequest.post(this.userRegURL, user); + } */ + + saveUser(user: User): Observable { + return this.apiRequest.post(this.userRegURL, user); + } + + /* company registration form */ + saveCompany(company: Sys_Account): Observable { + return this.apiRequest.post(this.companyRegURL, company); + } + + resetPassword(passwordResetRequest: PasswordResetComponent): Observable { + return this.apiRequest.post(this.resetPasswordURL, passwordResetRequest); + } + + /*==== CRUD APIS =====*/ + getAll(page?: number, size?: number): Observable { + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append( + "page", + typeof page === "number" ? page.toString() : "0" + ); + params = params.append( + "size", + typeof size === "number" ? size.toString() : "1000" + ); + //const _http = this.baseURL + '/all'; + return this.apiRequest.get(this.baseURL, params); + } + + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + + getByAccountId(): Observable { + const _http = this.baseURL + "/user-menu"; + return this.apiRequest.get(_http); + } + + create(any: any): Observable { + return this.apiRequest.post(this.baseURL, any); + } + + update(id: number, any: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, any); + } + + + /////// + + getStoredName() { + return this.localStorage.getItem("FullName"); + } + + removeStoredName() { + this.localStorage.removeItem("FullName"); + } + + sendEmail( email: any): Observable { + // const body = { account_id: accountId, email }; + const newbody = email; + const headers = new HttpHeaders({ 'Content-Type': 'application/json' }); + console.log(newbody); + return this.http.post(`${this.url}user/send_email`, newbody); + } + + sendOTP(email: string): Observable { + return this.http.post(`${this.url}user/resend_otp?email=${email}`, {}); + } + + // Method to verify OTP + verifyOTP(email: string, otp: string): Observable { + return this.http.post(`${this.url}user/otp_verification?email=${email}&otp=${otp}`, null); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/usergrpmaintaince.service.ts b/frontend/angular-clarity-master/src/app/services/admin/usergrpmaintaince.service.ts new file mode 100644 index 0000000..f8954be --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/usergrpmaintaince.service.ts @@ -0,0 +1,46 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import baseUrl from '../api/helper'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; +import { Usergrpmain } from '../../models/admin/usergrpma'; +@Injectable({ + providedIn: 'root' +}) +export class UsergrpmaintainceService { + private baseURL = "api/updateOneUsrGrp"; + constructor(private _http: HttpClient,private apiRequest: ApiRequestService,) { } + + public getAll() { + return this._http.get(`${baseUrl}/api/getAllUsrGrp`); + } + public getbyid(Id: any){ + return this._http.get(`${baseUrl}/api/getOneAppUser/${Id}`); + } + public getbyusergrpid(id:any){ + return this._http.get(`${baseUrl}/api1/getusracces1/${id}`); + } + public create(data: any){ + return this._http.post(`${baseUrl}/api/addOneUsrGrp`, data); + } +// update +public update(data: any){ + return this._http.post(`${baseUrl}/api/updateOneUsrGrp`, data); +} +updatei(id: number, projectSetup: Usergrpmain): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, projectSetup); +} +public getall(){ + return this._http.get(`${baseUrl}/api1/getAllData`); +} +public deleteusr(id:any){ + return this._http.delete(`${baseUrl}/api/delete_usrgrp/${id}`); +} +public delete(id:any,usrgrp:any){ +return this._http.delete(`${baseUrl}/api1/deleteGrpMenuAcces/${id}/${usrgrp}`); +} +public deletemain(id:any,usrgrp:any){ + return this._http.delete(`${baseUrl}/fndMenu/DelMenu_WithSub1/${id}/${usrgrp}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/admin/usermaintance.service.ts b/frontend/angular-clarity-master/src/app/services/admin/usermaintance.service.ts new file mode 100644 index 0000000..5c321e0 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/admin/usermaintance.service.ts @@ -0,0 +1,42 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class UsermaintanceService { + + constructor(private _http: HttpClient,) { } + public getAll() { + return this._http.get(`${baseUrl}/api/getAllAppUser`); + } + public getbyid(Id: any){ + return this._http.get(`${baseUrl}/api/getOneAppUser/${Id}`); + } + public create(data: any){ + return this._http.post(`${baseUrl}/api/addOneAppUser`, data); + } + // update + public update(data: any){ + return this._http.put(`${baseUrl}/api/updateAppUser`, data); + } + //newupdate + public updatenew(id:any,data: any){ + return this._http.put(`${baseUrl}/api/updateAppUserDto/${id}`, data); + } + public getallposition(){ + return this._http.get(`${baseUrl}/api/getAllPositions`); + } + public getbypositionid(Id:any){ + return this._http.get(`${baseUrl}/api/getPosition/${Id}`); + } + public getalldepartment(){ + return this._http.get(`${baseUrl}/api/getAllDepartments`); + } + public getbydepartmentid(Id:any){ + return this._http.get(`${baseUrl}/api/getDepartment/${Id}`); + } + public deleteusr(id:any){ + return this._http.delete(`${baseUrl}/api/delete_usr/${id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/alert.service.ts b/frontend/angular-clarity-master/src/app/services/alert.service.ts new file mode 100644 index 0000000..c19d894 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/alert.service.ts @@ -0,0 +1,70 @@ +import { Injectable } from '@angular/core'; +import { default as swal, SweetAlertOptions } from 'sweetalert2'; + +@Injectable({ + providedIn: 'root' +}) +export class AlertService { + constructor() { } + + error(text = 'เกิดข้อผิดพลาด', title = '') { + const option: SweetAlertOptions = { + title: title, + text: this.convertToText(text), + icon: 'error', + confirmButtonText: 'ตกลง' + }; + return swal.fire(option); + + } + + success(text = '', title = 'Success') { + const option: SweetAlertOptions = { + title: title, + text: this.convertToText(text), + icon: 'success', + confirmButtonText: 'Ok' + }; + return swal.fire(option); + + } + + serverError(text = 'เกิดข้อผิดพลาดในการเชื่อมต่อกับเซิร์ฟเวอร์', title = 'เกิดข้อผิดพลาด') { + const option: SweetAlertOptions = { + title: title, + text: this.convertToText(text), + icon: 'error', + confirmButtonText: 'ตกลง' + }; + return swal.fire(option); + + } + + confirm(text = 'คุณต้องการดำเนินการนี้ ใช่หรือไม่?', title = 'Are you sure?') { + const option: SweetAlertOptions = { + title: title, + text: this.convertToText(text), + icon: 'question', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes', + cancelButtonText: 'No' + }; + return swal.fire(option); + } + + convertToText(text) { + if (text && text.message) { + return text.message + } else if (text && text.error) { + return text.error + } else if (text && text.code) { + return text.code + } else { + return text ? JSON.stringify(text) : ''; + } + } + + +} diff --git a/frontend/angular-clarity-master/src/app/services/alerts.service.ts b/frontend/angular-clarity-master/src/app/services/alerts.service.ts new file mode 100644 index 0000000..4617822 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/alerts.service.ts @@ -0,0 +1,39 @@ +import { Injectable } from "@angular/core"; +import { NavigationStart, Router } from "@angular/router"; +import { Observable, Subject } from "rxjs"; + +@Injectable() +export class AlertService { + private subject = new Subject(); + + private keepAfterNavigationChange = false; + + constructor(private router: Router) { + // clear alert message on route change + router.events.subscribe((event) => { + if (event instanceof NavigationStart) { + if (this.keepAfterNavigationChange) { + // only keep for a single location change + this.keepAfterNavigationChange = false; + } else { + // clear alert + this.subject.next(); + } + } + }); + } + + success(message: string, keepAfterNavigationChange = false) { + this.keepAfterNavigationChange = keepAfterNavigationChange; + this.subject.next({ type: "success", text: message }); + } + + error(message: string, keepAfterNavigationChange = false) { + this.keepAfterNavigationChange = keepAfterNavigationChange; + this.subject.next({ type: "error", text: message }); + } + + getMessage(): Observable { + return this.subject.asObservable(); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/api/addemails.service.ts b/frontend/angular-clarity-master/src/app/services/api/addemails.service.ts new file mode 100644 index 0000000..e98291a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/addemails.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@angular/core'; +//import { id } from '@swimlane/ngx-datatable/release/utils'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from './api-request.service'; + +@Injectable({ + providedIn: 'root' +}) +export class AddemailsService { + + + private addemailUrl = 'token/addemails'; + + + + constructor( + private apirequest: ApiRequestService + + ) { } + + saveUser(data, id: number): Observable { + return this.apirequest.post(this.addemailUrl + "/" + id, data); + + } + +} diff --git a/frontend/angular-clarity-master/src/app/services/api/api-request.service.ts b/frontend/angular-clarity-master/src/app/services/api/api-request.service.ts new file mode 100644 index 0000000..3c24cd5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/api-request.service.ts @@ -0,0 +1,172 @@ +import { Injectable } from "@angular/core"; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpErrorResponse, +} from "@angular/common/http"; +import { Router } from "@angular/router"; +import { Observable, throwError } from "rxjs"; +import { UserInfoService } from "../user-info.service"; +import { AppConfig } from "../../app-config"; +import { catchError } from "rxjs/operators"; + +@Injectable() +export class ApiRequestService { + constructor( + private appConfig: AppConfig, + private http: HttpClient, + private router: Router, + private userInfoService: UserInfoService + ) {} + + /** + * This is a Global place to add all the request headers for every REST calls + */ + /*{let headers = new HttpHeaders({ + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Methods': 'POST, GET, DELETE, OPTIONS, PUT', + 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding, Accept-Language, Host, Referer, Connection, User-Agent, authorization, sw-useragent, sw-version' + });*/ + getHeaders(): HttpHeaders { + let headers = new HttpHeaders(); + //let token = this.userInfoService.getStoredToken(); + //console.log('Token from session storage: ', token); + headers = headers.append("Content-Type", "application/json"); + /* if (token !== null) { + headers = headers.append("Authorization", token); + } */ + return headers; + } + + getMultipartHeader(): HttpHeaders { + let headers = new HttpHeaders(); + headers = headers.append("Content-Type", "multipart/form-data"); + return headers; + + } + + errMsg: string = ''; + + handleError(error: HttpErrorResponse) { + let me = this; + console.log("handleError ", error.message); + switch(error.status) { + case 401: + this.errMsg = 'Forbidden'; + break; + case 404: + this.errMsg = 'Service not found'; + case 408: + this.errMsg = 'Request Timedout'; + case 500: + this.errMsg = 'Internal Server Error'; + default: + this.errMsg = 'Server Error'; + } + return throwError(error.message); + //return Observable.throw(error.message); + } + + get(url: string, urlParams?: HttpParams): Observable { + let me = this; + return this.http + .get(this.appConfig.baseApiPath + url, { + headers: this.getHeaders(), + params: urlParams, + }).pipe( + catchError((error) => { + return throwError(error || "Server error"); + }) + ) + } + + loginAuthentication(url: string, body: Object): Observable { + let me = this; + return this.http + .post(this.appConfig.baseApiPath + url, JSON.stringify(body), { + headers: this.getHeaders() + }).pipe( + catchError((error) => { + return throwError(error || "Server error"); + }) + ) + } + + // modified params + post(url: string, body: any, urlParams?: HttpParams): Observable { + let me = this; + let bodyTest = body instanceof Object ? JSON.stringify(body) : body; + //console.log('Post method String Vs. Object', bodyTest); + return this.http + .post(this.appConfig.baseApiPath + url, JSON.stringify(body), { + headers: this.getHeaders(), + params: urlParams, + }).pipe( + catchError((error) => { + return throwError(error || "Server error"); + }) + ) + } + + // [Multipart file Support] + postFormData(url: string, body: any, urlParams?: HttpParams): Observable { + //let me = this; + //headers: this.getMultipartHeader(), + return this.http + .post(this.appConfig.baseApiPath + url, body, { + params: urlParams, + reportProgress: true, + observe: 'events' + }).pipe( + catchError((error) => { + return throwError(error || "Server error"); + }) + ) + } + + // modified params + put(url: string, body: Object, urlParams?: HttpParams): Observable { + let me = this; + return this.http + .put(this.appConfig.baseApiPath + url, JSON.stringify(body), { + headers: this.getHeaders(), + params: urlParams, + }).pipe( + catchError((error) => { + return throwError(error || "Server error"); + }) + ) + } + + delete(url: string): Observable { + let me = this; + return this.http + .delete(this.appConfig.baseApiPath + url, { headers: this.getHeaders() }) + .pipe( + catchError((error) => { + return throwError(error || "Server error"); + }) + ) + } + + downloadFile(url: string, data: any[]): Observable { + return this.http.post(url, data, { responseType: 'blob' }).pipe( + catchError((error) => { + return throwError(error || 'Server error'); + }) + ); + } + + // For File Download + getFile(url: string, options: any): Observable { + return this.http.post(this.appConfig.baseApiPath + url, { ...options, responseType: 'blob' }).pipe( + catchError((error) => { + return throwError(error || 'Server error'); + }) + ); + } + +} diff --git a/frontend/angular-clarity-master/src/app/services/api/audittrail.service.ts b/frontend/angular-clarity-master/src/app/services/api/audittrail.service.ts new file mode 100644 index 0000000..c08d8ad --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/audittrail.service.ts @@ -0,0 +1,30 @@ +import { Injectable } from '@angular/core'; +import baseUrl from './helper'; +import { HttpClient } from '@angular/common/http'; +import { ApiRequestService } from './api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class AudittrailService { +apiurl="master/AuditItemReport"; +apiurl1="master/AuditItemReportCustom" + constructor(private _http: HttpClient, + private apiRequest: ApiRequestService,) { } + public getAll() { + return this._http.get(`${baseUrl}/master/AuditItemReport`); + + } + public gettable(tname:any){ + const formData:FormData = new FormData(); + formData.set("table",tname); + return this.apiRequest.postFormData(this.apiurl,formData); + } + public getdate(d1:any,d2:any,tname:any){ + const formData:FormData = new FormData(); + formData.set("id",null); + formData.set("d1",d1); + formData.set("d2",d2); + formData.set("table",tname); + return this.apiRequest.postFormData(this.apiurl1,formData); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/api/billingdemo.service.ts b/frontend/angular-clarity-master/src/app/services/api/billingdemo.service.ts new file mode 100644 index 0000000..9a69cf8 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/billingdemo.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; +import baseUrl from './helper'; +import { HttpClient } from '@angular/common/http'; +@Injectable({ + providedIn: 'root' +}) +export class BillingdemoService { + + constructor(private _http: HttpClient) { } + + public getAll() { + return this._http.get(`${baseUrl}/ncso_b/get-all`); + } + public getbyid(Id: any){ + return this._http.get(`${baseUrl}/ncso_b/get-one/${Id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/api/department.service.ts b/frontend/angular-clarity-master/src/app/services/api/department.service.ts new file mode 100644 index 0000000..9b891ac --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/department.service.ts @@ -0,0 +1,48 @@ +import { Injectable } from '@angular/core'; +import { Department } from '../../models/fnd/department'; +import { JwtHelperService } from '@auth0/angular-jwt'; +import { HttpClient, HttpParams,HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from './api-request.service'; +import { UserInfoService } from '../user-info.service'; +@Injectable({ + providedIn: 'root' +}) +export class DepartmentService { + jwtHelper: JwtHelperService = new JwtHelperService(); + + private baseURL = "api/getdepartment"; + constructor(private http: HttpClient, + private apiRequest: ApiRequestService, + private userInfoService: UserInfoService) { } + + getAll(page?: number, size?: number): Observable { + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + //const _http = this.baseURL + '/all'; + //console.log(this.userInfoService.getUserInfo().userId); + let id = this.userInfoService.getUserInfo().userId; + return this.apiRequest.get(this.baseURL, params); + } + + update(id: number, department: Department): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, department); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + create(depart:Department): Observable { + return this.apiRequest.post(this.baseURL, depart); + } + + +} diff --git a/frontend/angular-clarity-master/src/app/services/api/diputesemo.service.ts b/frontend/angular-clarity-master/src/app/services/api/diputesemo.service.ts new file mode 100644 index 0000000..972128d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/diputesemo.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; +import baseUrl from './helper'; +import { HttpClient } from '@angular/common/http'; +@Injectable({ + providedIn: 'root' +}) +export class DiputesemoService { + + constructor(private _http: HttpClient) { } + + public getAll() { + return this._http.get(`${baseUrl}/ncso_q/get-all`); + } + public getbyid(Id: any){ + return this._http.get(`${baseUrl}/ncso_q/get-one/${Id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/api/forgotpass.service.ts b/frontend/angular-clarity-master/src/app/services/api/forgotpass.service.ts new file mode 100644 index 0000000..8176718 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/forgotpass.service.ts @@ -0,0 +1,44 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from '../api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class ForgotpassService { + private url = "api/forgot"; + public localStorage: Storage = localStorage; + constructor(private http: HttpClient,) { } + + checkMailExists(email: string) { + return this.http.post(this.url+ "check-email", {"email": email}); + } + storeEmail(userInfoString: string) { + this.localStorage.setItem("registeredEmail", userInfoString); + } + //Store userinfo from session storage + + //Get email from session storage ( WILL REMOVE AFTER REGISTER) + getStoredEmail(): string | null { + try { + let userInfoString: string = this.localStorage.getItem( + "registeredEmail" + ); + if (userInfoString) { + return userInfoString; + } else { + return null; + } + } catch (e) { + return null; + } + } + sendemail(email:string){ + const params = new HttpParams() + .set('email',email) + console.log(email); + return this.http.post(`${baseUrl}/api/resources/forgotpassword`,params) + } + resetpass(data:any,id:any){ + return this.http.post(`${baseUrl}/api/resources/savePassword/${id}`,data); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/api/helper.ts b/frontend/angular-clarity-master/src/app/services/api/helper.ts new file mode 100644 index 0000000..7f1e8f1 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/helper.ts @@ -0,0 +1,5 @@ +import{environment} from 'src/environments/environment'; + +let baseUrl = environment.backendUrl; +//let baseUrl= `http://cns-portal-backend:30166`; +export default baseUrl; diff --git a/frontend/angular-clarity-master/src/app/services/api/itemdemo.service.ts b/frontend/angular-clarity-master/src/app/services/api/itemdemo.service.ts new file mode 100644 index 0000000..7cf0b14 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/itemdemo.service.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@angular/core'; +import baseUrl from './helper'; +import { HttpClient } from '@angular/common/http'; +@Injectable({ + providedIn: 'root' +}) +export class ItemdemoService { + + constructor(private _http: HttpClient) { } + public getAll() { + return this._http.get(`${baseUrl}/ncso_i/get-all`); + } + public getbyid(Id: any){ + return this._http.get(`${baseUrl}/ncso_i/get-one/${Id}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/api/login.service.ts b/frontend/angular-clarity-master/src/app/services/api/login.service.ts new file mode 100644 index 0000000..0b1cb1a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/login.service.ts @@ -0,0 +1,113 @@ +import { Injectable } from '@angular/core'; +import { Router } from '@angular/router'; + +import { Observable, BehaviorSubject } from 'rxjs'; +import { UserInfoService, LoginInfoInStorage} from '../user-info.service'; +import { ApiRequestService } from './api-request.service'; +import { HttpClient } from '@angular/common/http'; +import { ToastrService } from 'ngx-toastr'; + +export interface LoginRequestParam{ + //username:string; + email:string; + password:string; +} + +@Injectable() +export class LoginService { + private storage: Storage = sessionStorage; + public landingPage:string = "/cns-portal/dashboard"; + constructor( + private router:Router, + private userInfoService: UserInfoService, + private apiRequest: ApiRequestService, + private httpRequest: HttpClient, + private toastr: ToastrService, + ) {} + + + + getToken(email:string, password:string): Observable { + let bodyData: LoginRequestParam = { + //"username": username, + "email": email, + "password": password, + } + /* + Using BehaviorSubject instead of Subject + In Angular services are initialized before the components, if any component is + subscribing, it will only receive events which are executed after subscription. + therefore if you put a syncronize next() in the service, the component wont get it. + + A BehaviourSubject will always provide the values wheather the subscription happened after or before event + + */ + + let loginDataSubject:BehaviorSubject = new BehaviorSubject([]); // Will use this BehaviorSubject to emit data that we want after ajax login attempt + let loginInfoReturn:LoginInfoInStorage; // Object that we want to send back to Login Page + + this.apiRequest.loginAuthentication('token/session', bodyData) + .subscribe(jsonResp => { + console.log('login response in service : ', jsonResp); + if (jsonResp.operationMessage=='Login Failed') { + this.toastr.warning('Not Login Getting Error check your Username and password'); + } + if (jsonResp !== undefined && jsonResp !== null && jsonResp.operationStatus === "SUCCESS"){ + //Create a success object that we want to send back to login page + ////"displayName": jsonResp.item.fullname, + //"username" : jsonResp.item.username, + loginInfoReturn = { + "success" : true, + "message" : jsonResp.operationMessage, + "landingPage": this.landingPage, + "user" : { + "userId" : jsonResp.item.userId, + "email" : jsonResp.item.email, + "displayName": jsonResp.item.firstName, + "username" : jsonResp.item.username, + "roles" : jsonResp.item.roles, + "token" : jsonResp.item.token, + + }, + }; + console.log(loginInfoReturn.user); + if(jsonResp !== undefined && jsonResp !== null && jsonResp.operationStatus === "SUCCESS"){ + this.toastr.success(`Welcome To home Page!! your Role is ${jsonResp.item.roles}`); + } + // store username and jwt token in session storage to keep user logged in between page refreshes + this.userInfoService.storeUserInfo(JSON.stringify(loginInfoReturn.user)); + } + else { + //Create a faliure object that we want to send back to login page + loginInfoReturn = { + "success":false, + "message":jsonResp.operationMessage, + "landingPage":"/login" + }; + } + loginDataSubject.next(loginInfoReturn); + }, + err => { + console.log('login error ', err); + loginInfoReturn = { + "success": false, + "message": err.url + " >>> " + err.statusText + "[" + err.status +"]", + "landingPage": "/login" + }; + if (err) { + this.toastr.error('Getting Server Error'); + } + }); + + return loginDataSubject; + } + + logout(navigatetoLogout=true): void { + // clear token remove user from local storage to log user out + this.userInfoService.removeUserInfo(); + if(navigatetoLogout){ + this.router.navigate(["logout"]); + } + } + +} diff --git a/frontend/angular-clarity-master/src/app/services/api/query-runner.service.ts b/frontend/angular-clarity-master/src/app/services/api/query-runner.service.ts new file mode 100644 index 0000000..bcfe7dd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/query-runner.service.ts @@ -0,0 +1,20 @@ +import { Injectable } from '@angular/core'; +import { HttpParams } from '@angular/common/http'; +import { ApiRequestService } from './api-request.service'; +import { Observable } from 'rxjs'; +@Injectable({ + providedIn: 'root' +}) +export class QueryRunnerService { + private baseURL = "api/report-data"; + constructor(private apiRequest: ApiRequestService) { } + getById(report_id:number, page?: number, size?: number): Observable { + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append("report_id", report_id.toString()); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + //const _http = this.baseURL + '/all'; + return this.apiRequest.get(this.baseURL, params); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/api/realnet-menu.service.ts b/frontend/angular-clarity-master/src/app/services/api/realnet-menu.service.ts new file mode 100644 index 0000000..4ece66b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/realnet-menu.service.ts @@ -0,0 +1,43 @@ +import { HttpParams } from "@angular/common/http"; +import { Injectable } from "@angular/core"; +import { Rn_Main_Menu } from "../../models/builder/Rn_Main_Menu"; +import { Observable } from "rxjs"; +import { UserInfoService } from "../user-info.service"; +import { ApiRequestService } from "./api-request.service"; + +@Injectable() +export class RealnetMenuService { + private baseURL = "api/realnet-menu"; + constructor( + private apiRequest: ApiRequestService, + private userInfoService: UserInfoService + ) {} + + getAll(page?: number, size?: number): Observable { + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + //const _http = this.baseURL + '/all'; + return this.apiRequest.get(this.baseURL, params); + } + + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + + getByAccountId(): Observable { + const _http = this.baseURL + "/user-menu"; + return this.apiRequest.get(_http); + } + + create(rn_Main_Menu: Rn_Main_Menu): Observable { + return this.apiRequest.post(this.baseURL, rn_Main_Menu); + } + + update(id: number, rn_Main_Menu: Rn_Main_Menu): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, rn_Main_Menu); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/api/report-builder.service.ts b/frontend/angular-clarity-master/src/app/services/api/report-builder.service.ts new file mode 100644 index 0000000..22a0a1f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/report-builder.service.ts @@ -0,0 +1,287 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import { ApiRequestService } from './api-request.service'; +import { Observable } from 'rxjs'; +import { ReportBuilder } from '../../models/builder/ReportBuilder'; +import { ReportBuilderQuery } from '../../models/builder/ReportBuilderQuery'; +import { TableList } from '../../models/fnd/TableList'; +import { RptBuilder } from 'src/app/models/builder/rptBuilder'; +import baseUrl from '../api/helper'; +import { saveAs } from 'file-saver'; + +@Injectable({ + providedIn: 'root' +}) +export class ReportBuilderService { + private reportBaseURL ='api/report-builder-by-id'; + private reportBaseURLSubmit ='api/report-builder'; + private masterQueryUrl ='api/add-master-query'; + private storage: Storage = sessionStorage; + private moduleIdKey: string = "moduleId"; + private baseURLMasterQuery="api/master-query"; + private baseURL="api/edit-report"; + private reportbuild2url="api/add-report"; + private servicereportsave="api/report-builder_service"; + private updatereportservice="api/updatereport"; + + private databaselisturl='Table_list' + private colurl='fndMenu/loadcolumn'; + private saveurl='FndQuery/query'; + constructor(private apiRequest: ApiRequestService, private _http:HttpClient) { } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + + buildReport(id: number) { + let params: HttpParams = new HttpParams(); + params = params.append("id", id.toString()); + return this.apiRequest.get("api/build_report", params); + } + + getModuleId(): number { + let modId = +this.storage.getItem(this.moduleIdKey); + return modId; + } + + getAll(moduleId: number, page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + params = params.append("moduleId", moduleId.toString()); + // get all + return this.apiRequest.get(this.reportBaseURL, params); + } + + //save report + create(fbHeader: ReportBuilder, moduleId: number): Observable { + //`${this.baseURL}` + let params: HttpParams = new HttpParams(); + params = params.append("moduleId", moduleId.toString()); + // params = params.append("formType", formType); + return this.apiRequest.post(this.reportBaseURLSubmit, fbHeader, params); + } + + //save report service + createservicereport(fbHeader: ReportBuilder, moduleId: number): Observable { + //`${this.baseURL}` + let params: HttpParams = new HttpParams(); + params = params.append("moduleId", moduleId.toString()); + // params = params.append("formType", formType); + return this.apiRequest.post(this.servicereportsave, fbHeader, params); + } + + //save report + createQuery(reportId: number): Observable { + //`${this.baseURL}` + let params: HttpParams = new HttpParams(); + params = params.append("reportId", reportId.toString()); + // params = params.append("formType", formType); + return this.apiRequest.post(this.masterQueryUrl,params); + } + + // update(reportId: number, functionRegister: ReportBuilder): Observable { + // let params: HttpParams = new HttpParams(); + // params = params.append("reportId", reportId.toString()); + // return this.apiRequest.put(this.masterQueryUrl/reportId, functionRegister); + // } + + update(id: number, functionRegister: ReportBuilder): Observable { + const _http = this.masterQueryUrl + "/" + id; + return this.apiRequest.put(_http, functionRegister); + } + + updateservicereport(id: number, functionRegister: ReportBuilder): Observable { + const _http = this.updatereportservice + "/" + id; + return this.apiRequest.put(_http, functionRegister); + } + + getMasterQuery(id: number): Observable { + const _http = this.baseURLMasterQuery + "/" + id; + return this.apiRequest.get(_http); + } + + getMasterData(query:string): Observable { + //Create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append('sql_query', query); + return this.apiRequest.get('api/master-query-data',params); +} + + + report2(servicename):Observable +{ + console.log("in service",servicename); + + // let params: HttpParams = new HttpParams(); + // params = params.append('service_name', servicename); + + // console.log(this.reportbuild2url,params); + + return this.apiRequest.post(this.reportbuild2url,servicename); +} + + +//savequery +saveq(data:any):Observable{ + return this.apiRequest.post(this.saveurl,data); +} +//getall +getall(){ + return this.apiRequest.get(this.saveurl); +} + +/////// +getreportdata(apiname):Observable +{ + var url="api"+"/"+apiname; + console.log(url) + + return this.apiRequest.get(url); + +} +getdatabse(): Observable{ + return this.apiRequest.get(`SqlworkbenchSqlcont/sql`); + //return this.apiRequest.get(this.databaselisturl); +} +getTableListn(val:any): Observable { + return this.apiRequest.get(`Table_list/${val}`); +} +getcolListn(val:any,val1:any): Observable { + return this.apiRequest.get(`Table_list/${val}/${val1}`); +} + +//column list for multiple tables +getColumnList(tableSchema: any, tables: any): Observable { + // return this._http.get( `http://localhost:9191/AllTable_list/${tableSchema}`,tables); + const params = new HttpParams().set('str', tables.join(',')); + return this._http.get(`${baseUrl}/AllTable_list/${tableSchema}`, { params: params }); +} + +//working column list for multiple tables with alias +getAllColumnsFromAllTables(tableNames: any): Observable { + const url = `${baseUrl}/Alias_Table_list/${tableNames}`; + return this._http.get(url); +} + +getcollist(table:any){ + const _http = this.colurl+ "/" + table; + return this.apiRequest.get(_http); + //return this.apiRequest.get(`this.colurl/${table}`); +} +createdb(data:any){ + return this.apiRequest.post(`SqlworkbenchSqlcont/sql`,data); +} + +updateSqlModel(id: number, sqlModel: any): Observable { + return this.apiRequest.put(`SqlworkbenchSqlcont/sql/${id}`, sqlModel); +} + +getSqlModelById(id: number): Observable { + return this.apiRequest.get(`SqlworkbenchSqlcont/sql/${id}`); +} + +deleteSqlModel(id: number): Observable { + return this.apiRequest.delete(`SqlworkbenchSqlcont/sql/${id}`); +} + +getallentity(){ + return this.apiRequest.get(this.reportBaseURLSubmit); +} + + +////////// rpt builders ////////////// + +saveData(data: RptBuilder): Observable { + return this.apiRequest.post(`Rpt_builder/Rpt_builder`, data); +} + +getDetails(): Observable { + return this.apiRequest.get(`Rpt_builder/Rpt_builder`); +} + +getDetailsById(id: number): Observable { + return this.apiRequest.get(`Rpt_builder/Rpt_builder/${id}`); +} + +deleteById(id: number): Observable { + return this.apiRequest.delete(`Rpt_builder/Rpt_builder/${id}`); +} + +updateData(data: any, id: number): Observable { + return this.apiRequest.put(`Rpt_builder/Rpt_builder/${id}`, data); +} + + +////////// rpt builders 2////////////// + +saverbData(data: any): Observable { + return this.apiRequest.post(`Rpt_builder2/Rpt_builder2`, data); +} + +getrbDetails(): Observable { + return this.apiRequest.get(`Rpt_builder2/Rpt_builder2`); +} + +getrbDetailsById(id: number): Observable { + return this.apiRequest.get(`Rpt_builder2/Rpt_builder2/${id}`); +} + +deletrbById(id: number): Observable { + return this.apiRequest.delete(`Rpt_builder2/Rpt_builder2/${id}`); +} + +updaterbData(data: any, id: number): Observable { + return this.apiRequest.put(`Rpt_builder2/Rpt_builder2/${id}`, data); +} + +updaterbLineData(data: any, id: number): Observable { + return this.apiRequest.put(`Rpt_builder2_lines/update/${id}`, data); +} + +getrbLineDetailsById(id: number): Observable { + return this.apiRequest.get(`Rpt_builder2_lines/Rpt_builder2_lines/${id}`); +} + +/// rpt builders 2 html +getStdParamById(id: number): Observable { + return this.apiRequest.get(`Rpt_builder2/html/build_report2/${id}`); +} +//get key from URL +getcolumnDetailsByurl(url: string): Observable { + const apiUrl = `Rpt_builder2_lines/geturlkeybyurl?url=${url}`; + return this.apiRequest.get(apiUrl); +} + +getAllDetailsByurl(url: string): Observable { + const apiUrl = `Rpt_builder2_lines/fetch_data_url?url=${url}`; + return this.apiRequest.get(apiUrl); +} + + + + + +///////////////////////////////////////////// DOWNLOADS +// downloadFile(format:any,data: any): Observable { +// return this.apiRequest.post(`rbbuilder/fileconverter/downloadFile/${format}`, data); +// } + +downloadFile(format: string, dataList: any[],name?:String): void { + const url = `${baseUrl}/rbbuilder/fileconverter/downloadFile/${format}`; + this.apiRequest.downloadFile(url, dataList).subscribe( + (response: Blob) => { + saveAs(response, `${name}.${format}`); + }, + (error) => { + console.error('Error downloading file:', error); + } + ); +} + + + +} diff --git a/frontend/angular-clarity-master/src/app/services/api/sequence.service.ts b/frontend/angular-clarity-master/src/app/services/api/sequence.service.ts new file mode 100644 index 0000000..687521e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/sequence.service.ts @@ -0,0 +1,30 @@ +import { Injectable } from '@angular/core'; +import { ApiRequestService } from './api-request.service'; + +@Injectable({ + providedIn: 'root' +}) +export class SequenceService { + + constructor(private apiRequest: ApiRequestService,) { } + public getAll() { + return this.apiRequest.get(`sureserve/sequence/seq`); + } + public getbyid(Id: any){ + return this.apiRequest.get(`sureserve/sequence/seq/${Id}`); + } + + public create(data: any){ + return this.apiRequest.post(`sureserve/sequence/create`, data); + } +// update +public update(id:any,data: any){ + return this.apiRequest.put(`sureserve/sequence/seq/${id}`, data); +} + + +public delete(id:any){ +return this.apiRequest.delete(`sureserve/sequence/seq/${id}`); +} + +} diff --git a/frontend/angular-clarity-master/src/app/services/api/table-setup.service.ts b/frontend/angular-clarity-master/src/app/services/api/table-setup.service.ts new file mode 100644 index 0000000..7e6af52 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/table-setup.service.ts @@ -0,0 +1,29 @@ +import { Injectable } from '@angular/core'; +import { RbTables } from '../../models/builder/RbTables'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from './api-request.service'; +import { HttpParams } from '@angular/common/http'; +import { TableList } from '../../models/fnd/TableList'; + +@Injectable({ + providedIn: 'root' +}) +export class TableSetupService { + private baseURL = 'api/add-tables'; + private baseURL2 = 'api/add-alltables'; + private tableListUrl ='api/table-list'; + private tablelisturl='api/Table_list' + constructor(private apiRequest: ApiRequestService) { } + create(rb_tables: RbTables,reportId: number) :Observable { + let params: HttpParams = new HttpParams(); + params = params.append("reportId", reportId.toString()); + return this.apiRequest.post(this.baseURL2, rb_tables,params); +} + +getTableList(): Observable { + return this.apiRequest.get(this.tableListUrl); +} +getTableListn(): Observable { + return this.apiRequest.get(this.tablelisturl); +} +} diff --git a/frontend/angular-clarity-master/src/app/services/api/translate.service.ts b/frontend/angular-clarity-master/src/app/services/api/translate.service.ts new file mode 100644 index 0000000..0dbbf91 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/api/translate.service.ts @@ -0,0 +1,19 @@ +import { Injectable, Inject } from '@angular/core'; +import { AppConfig } from '../../app-config'; + +@Injectable() +export class TranslateService { + constructor(private appConfig:AppConfig) { + // Code to get Locale Info from Session Storage + } + + getDateString(datenum:number):string{ + return new Date(datenum).toLocaleDateString(this.appConfig.locale); + } + + getCurrencyString(number:number):string { + return number.toLocaleString(this.appConfig.locale, this.appConfig.currencyFormat); + } + + +} diff --git a/frontend/angular-clarity-master/src/app/services/auth_guard.service.ts b/frontend/angular-clarity-master/src/app/services/auth_guard.service.ts new file mode 100644 index 0000000..0711613 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/auth_guard.service.ts @@ -0,0 +1,40 @@ +import { Injectable } from '@angular/core'; +import { UserInfoService } from './user-info.service'; +import { LoginService } from './api/login.service'; +import { Router, CanActivate, CanActivateChild,ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; + +@Injectable() +export class AuthGuard implements CanActivate, CanActivateChild { + + constructor( + private router: Router, + private loginService: LoginService, + private userInfoService: UserInfoService + ) { } + + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { + //console.log('canActivate : ', state); + + let url: string = state.url; + + return this.checkLogin(url); + //return true; + } + + canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { + return this.canActivate(route, state); + } + + checkLogin(url: string): boolean { + if (this.userInfoService.isLoggedIn()) { + return true; + } + console.log("User is not logged - This routing guard prvents redirection to any routes that needs logging."); + //Store the original url in login service and then redirect to login page + this.loginService.landingPage = url; + this.router.navigate(['login',]); + return false; + } + + +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/additionalcontainer.service.spec.ts b/frontend/angular-clarity-master/src/app/services/builder/additionalcontainer.service.spec.ts new file mode 100644 index 0000000..439f06b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/additionalcontainer.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { AdditionalcontainerService } from './additionalcontainer.service'; + +describe('AdditionalcontainerService', () => { + let service: AdditionalcontainerService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(AdditionalcontainerService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/builder/additionalcontainer.service.ts b/frontend/angular-clarity-master/src/app/services/builder/additionalcontainer.service.ts new file mode 100644 index 0000000..439addb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/additionalcontainer.service.ts @@ -0,0 +1,75 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; +import { ApiRequestService } from '../api/api-request.service'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class AdditionalcontainerService { + baseurl = environment.sureops; + private baseURL = "Gaurav_testing/Gaurav_testing" ; + constructor(private apiRequest: ApiRequestService, + private _http: HttpClient,) { } + + + saveData(data: any): Observable { + const url = `${this.baseurl}/sureops/Additional_container/Additional_container`; + return this._http.post(url, data); + } + + getDetails(): Observable { + const url = `${this.baseurl}/sureops/Additional_container/Additional_container`; + return this._http.get(url); + } + + getDetailsById(id: number): Observable { + const url = `${this.baseurl}/sureops/Additional_container/Additional_container/${id}`; + return this._http.get(url); + } + + deleteById(id: number): Observable { + const url = `${this.baseurl}/sureops/Additional_container/Additional_container/${id}`; + return this._http.delete(url); + } + + update(data: any, id: number): Observable { + const url = `${this.baseurl}/sureops/Additional_container/Additional_container/${id}`; + return this._http.put(url, data); + } + + ///copy ADDITIONAL CONTAINER TO CREATE DEPLOYMENT + public copyToCreateDeployment(projId: number, profileId: number, service: string): Observable { + const url = `${this.baseurl}/sureops/Additional_container/copt_to_deployment/${projId}/${profileId}/${service}`; + return this._http.get(url); + } +// get all by project id and profile id + getAllContainers(projId: number, profileId: number): Observable { + const url = `${this.baseurl}/sureops/Additional_container/copt_to_deployment/${projId}/${profileId}`; + return this._http.get(url); + } + + + +///////////////////////////////////// + +getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); +} +getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); +} +create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); +} +updategaurav(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); +} +delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); +} +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/dashboard.service.spec.ts b/frontend/angular-clarity-master/src/app/services/builder/dashboard.service.spec.ts new file mode 100644 index 0000000..79e72a6 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/dashboard.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { DashboardService } from './dashboard.service'; + +describe('DashboardService', () => { + let service: DashboardService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(DashboardService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/builder/dashboard.service.ts b/frontend/angular-clarity-master/src/app/services/builder/dashboard.service.ts new file mode 100644 index 0000000..71fef84 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/dashboard.service.ts @@ -0,0 +1,116 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { BehaviorSubject, Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; + +@Injectable({ + providedIn: 'root' +}) +export class DashboardService { + + private getAllURL = 'get_module_id'; + private addDataURl = 'Savedata'; + private deleteFieldURL = 'delete_by_header_id'; + private getbyidURL = 'get_dashboard_headerbyid'; + private editURL = 'update_Dashbord1_Line'; + private updateURL = 'update_Dashbord1_Lineby_id'; + constructor(private _http: HttpClient, + private apiRequest: ApiRequestService,) + { + + } + + getAllDash(): Observable { + // create Request URL params + return this.apiRequest.get(`get_Dashboard_header`); + } + + getAllByModuleId(module_id: number,page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + params = params.append("module_id", module_id.toString()); + // get all + return this.apiRequest.get(this.getAllURL, params); + } + + create(data:any): Observable { + return this.apiRequest.post(this.addDataURl, data); + } + + deleteField(id:number){ + let _http = this.deleteFieldURL + "/" + id; + return this.apiRequest.delete(_http); + } + + getById(id:number) + { + let _http = this.getbyidURL + "/" + id; + return this.apiRequest.get(_http); + } + + addToDB(line:any):Observable + { + return this.apiRequest.put(this.editURL,line); + } + UpdateLineData(id:number, line:any) + { + // line = { + // headers: new HttpHeaders({ + // 'Content-Type': 'application/json' + // }) + // }; + let _http = this.updateURL + "/" + id; + return this.apiRequest.put(_http,line); + } +getcount(moduleId: number):Observable{ + return this.apiRequest.get(`get_dashboard/${moduleId}`); +} + +updateDash(dashboardHeader: any): Observable { + return this.apiRequest.put('update_dashboard_header', dashboardHeader); +} + + + + +///////schedule +public saveData(data: any): Observable { + return this.apiRequest.post(`DashboardSchedule/DashboardSchedule`, data); +} + +public getDetails(): Observable { + return this.apiRequest.get(`DashboardSchedule/DashboardSchedule`); +} + +public getDetailsById(id: number): Observable { + return this.apiRequest.get(`DashboardSchedule/DashboardSchedule/${id}`); +} + +public deleteById(id: number): Observable { + return this.apiRequest.delete(`DashboardSchedule/DashboardSchedule/${id}`); +} + +public updateData(data: any, id: number): Observable { + return this.apiRequest.put(`DashboardSchedule/DashboardSchedule/${id}`, data); +} + +private toggleSubject = new BehaviorSubject(false); + +// Observable to subscribe to toggle changes +toggle$ = this.toggleSubject.asObservable(); + +// Function to update the toggle value +updateToggle(value: boolean) { + this.toggleSubject.next(value); +} + +private originalData: any[] = []; // Your original data goes here +private filteredDataSubject = new BehaviorSubject([]); +filteredData$: Observable = this.filteredDataSubject.asObservable(); + + + +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/dashboard3.service.spec.ts b/frontend/angular-clarity-master/src/app/services/builder/dashboard3.service.spec.ts new file mode 100644 index 0000000..12b63dd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/dashboard3.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { Dashboard3Service } from './dashboard3.service'; + +describe('Dashboard3Service', () => { + let service: Dashboard3Service; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(Dashboard3Service); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/builder/dashboard3.service.ts b/frontend/angular-clarity-master/src/app/services/builder/dashboard3.service.ts new file mode 100644 index 0000000..bcfedcf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/dashboard3.service.ts @@ -0,0 +1,308 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams } from "@angular/common/http"; +import { Observable } from 'rxjs'; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import baseUrl from '../api/helper'; +import { BehaviorSubject } from 'rxjs'; +@Injectable({ + providedIn: 'root' +}) +export class Dashboard3Service { + getAdditionalChartData() { + throw new Error('Method not implemented.'); + } + private getAllURL = 'get_module_id'; + private addDataURl = 'Savedata'; + private deleteFieldURL = 'delete_by_header_id'; + private getbyidURL = 'get_dashboard_headerbyid'; + private editURL = 'update_Dashbord1_Line'; + private updateURL = 'update_Dashbord1_Lineby_id'; + constructor(private _http: HttpClient, + private apiRequest: ApiRequestService) { } + getAll(module_id: number,page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + params = params.append("module_id", module_id.toString()); + // get all + return this.apiRequest.get(this.getAllURL, params); + } + + create(data:any): Observable { + return this.apiRequest.post(this.addDataURl, data); + } + + deleteField(id:number){ + let _http = this.deleteFieldURL + "/" + id; + return this.apiRequest.delete(_http); + } + + getById(id:number) + { + let _http = this.getbyidURL + "/" + id; + return this.apiRequest.get(_http); + } + + addToDB(line:any):Observable + { + return this.apiRequest.put(this.editURL,line); + } + UpdateLineData(id:number, line:any) + { + // line = { + // headers: new HttpHeaders({ + // 'Content-Type': 'application/json' + // }) + // }; + let _http = this.updateURL + "/" + id; + return this.apiRequest.put(_http,line); + } +getcount(moduleId: number):Observable{ + return this.apiRequest.get(`get_dashboard/${moduleId}`); +} + +updateDash(dashboardHeader: any): Observable { + return this.apiRequest.put('update_dashboard_header', dashboardHeader); +} +///////////////////////////////////////////////////////////////////// +resetConditions() { + this.ids = []; // Reset the ids array to an empty array + this.numberIds = []; + this.passwordIds = []; + this.textareaIds = []; + this.dateIds = []; + this.datetimeIds = []; + this.emailIds = []; + this.selectIds = []; + this.radioIds = []; + this.checkboxIds = []; + this.fileuloadIds = []; + this.urlIds = []; + this.decimalIds = []; + this.percentageIds = []; + this.buttonIds = []; +} + +//////////// Text +ids: any[] = []; +setCondition(condition: any) { + this.ids.push(condition); +} + +getConditions(): any[] { + return this.ids; +} + + +////////// Number +numberIds: any[] = []; +setnumber(id: any) { + this.numberIds.push(id); +} + +getnumber(): any[] { + return this.numberIds; +} +////////////// password +passwordIds: any[] = []; +setpassword(id: any) { + this.passwordIds.push(id); +} + +getpassword(): any[] { + return this.passwordIds; +} + +////////////// Textarea +textareaIds: any[] = []; +setTextarea(id: any) { + this.textareaIds.push(id); +} + +getTextarea(): any[] { + return this.textareaIds; +} + +////////////// Date +dateIds: any[] = []; +setDate(id: any) { + this.dateIds.push(id); +} + +getDate(): any[] { + return this.dateIds; +} + +////////////// Datetime +datetimeIds: any[] = []; +setDatetime(id: any) { + this.datetimeIds.push(id); +} + +getDatetime(): any[] { + return this.datetimeIds; +} + +////////////// Email +emailIds: any[] = []; +setEmail(id: any) { + this.emailIds.push(id); +} + +getEmail(): any[] { + return this.emailIds; +} + +////////////// Select +selectIds: any[] = []; +setSelect(id: any) { + this.selectIds.push(id); +} + +getSelect(): any[] { + return this.selectIds; +} + +////////////// Radio +radioIds: any[] = []; +setRadio(id: any) { + this.radioIds.push(id); +} + +getRadio(): any[] { + return this.radioIds; +} + +////////////// Checkbox +checkboxIds: any[] = []; +setCheckbox(id: any) { + this.checkboxIds.push(id); +} + +getCheckbox(): any[] { + return this.checkboxIds; +} + +////////////// fileupload +fileuloadIds: any[] = []; +setFileUpload(id: any) { + this.fileuloadIds.push(id); +} + +getFileupload(): any[] { + return this.fileuloadIds; +} + +////////////// Url +urlIds: any[] = []; +setUrl(id: any) { + this.urlIds.push(id); +} + +getUrl(): any[] { + return this.urlIds; +} +////////////// Decimal +decimalIds: any[] = []; +setDecimal(id: any) { + this.decimalIds.push(id); +} + +getDecimal(): any[] { + return this.decimalIds; +} +////////////// Percentage +percentageIds: any[] = []; +setPercentage(id: any) { + this.percentageIds.push(id); +} + +getPercentage(): any[] { + return this.percentageIds; +} +////////////// Button +buttonIds: any[] = []; +setButton(id: any) { + this.buttonIds.push(id); +} + +getButton(): any[] { + return this.buttonIds; +} + + + + + + + + + +getAllDash(): Observable { + // create Request URL params + return this.apiRequest.get(`get_Dashboard_header`); + } + +getAllByModuleId(module_id: number,page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + params = params.append("module_id", module_id.toString()); + // get all + return this.apiRequest.get(this.getAllURL, params); + } + +///////schedule +public saveData(data: any): Observable { + return this.apiRequest.post(`DashboardSchedule/DashboardSchedule`, data); +} + +public getDetails(): Observable { + return this.apiRequest.get(`DashboardSchedule/DashboardSchedule`); +} + +public getDetailsById(id: number): Observable { + return this.apiRequest.get(`DashboardSchedule/DashboardSchedule/${id}`); +} + +public deleteById(id: number): Observable { + return this.apiRequest.delete(`DashboardSchedule/DashboardSchedule/${id}`); +} + +public updateData(data: any, id: number): Observable { + return this.apiRequest.put(`DashboardSchedule/DashboardSchedule/${id}`, data); +} + +//////////////////////////////////////////////////////////////////////////// + + +public getDynamicDashDetails(): Observable { + return this.apiRequest.get(`Dashboard/Dashboard`); +} + +public getChartData(tableName: string, jobType: string, xAxis?:any,yAxes?:any ): Observable { + const url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&xAxis=${xAxis}&yAxes=${yAxes}`; + return this._http.get(url); +} + +public getUrlChartData(tableName: string, jobType: string, xAxis:any,yAxes:any,store:any,chartUrl:any): Observable { + const url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&url=${chartUrl}&xAxis=${xAxis}&yAxes=${yAxes}&datastore_name=${store}`; + return this._http.get(url); +} + +featchDynamicUrlDetails(url): Observable { + return this._http.get(`${url}`); +} + + +private filteredDataSubject = new BehaviorSubject([]); +filteredData$ = this.filteredDataSubject.asObservable(); + +updateFilteredData(filteredData: any[]) { + this.filteredDataSubject.next(filteredData); +} +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/icon.service.ts b/frontend/angular-clarity-master/src/app/services/builder/icon.service.ts new file mode 100644 index 0000000..f8dd1de --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/icon.service.ts @@ -0,0 +1,63 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { ApiRequestService } from "../api/api-request.service"; +@Injectable({ + providedIn: 'root' +}) +export class IconService { + private addURL = "api/addFavById"; + private removeURL= "api/removeFavById"; + private pinurl ="api/addPinById"; + private pinremove ="api/removePinById"; + private starurl ="api/addStarById"; + private starremove ="api/removeStarById"; + private watchurl ="api/addWatchlistById"; + private watchremove = "api/removeWatchlistById"; + private futureurl = "api/addFuturisticById"; + private futureremove = "api/removeFuturisticById"; + private archurl ="api/addArchiveById"; + constructor(private apiRequest: ApiRequestService,) { } + create(data:any): Observable { + return this.apiRequest.post(this.addURL, data); + } + + delete(id: number): Observable { + const _http = this.removeURL + "/" + id; + return this.apiRequest.delete(_http); + } + createpin(data:any): Observable { + return this.apiRequest.post(this.pinurl, data); + } + + deletepin(id: number): Observable { + const _http = this.pinremove + "/" + id; + return this.apiRequest.delete(_http); + } + createstar(data:any): Observable { + return this.apiRequest.post(this. starurl, data); + } + + deletestar(id: number): Observable { + const _http = this.starremove + "/" + id; + return this.apiRequest.delete(_http); + } + createwatch(data:any): Observable { + return this.apiRequest.post(this. watchurl, data); + } + + deletewatch(id: number): Observable { + const _http = this.watchremove + "/" + id; + return this.apiRequest.delete(_http); + } + createfuture(data:any): Observable { + return this.apiRequest.post(this.futureurl, data); + } + + deletefuture(id: number): Observable { + const _http = this.futureremove + "/" + id; + return this.apiRequest.delete(_http); + } + createarch(data:any): Observable { + return this.apiRequest.post(this.archurl, data); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/modulesetup.service.ts b/frontend/angular-clarity-master/src/app/services/builder/modulesetup.service.ts new file mode 100644 index 0000000..8ccf61c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/modulesetup.service.ts @@ -0,0 +1,172 @@ +import { Injectable } from '@angular/core'; +import { ModuleSetup } from "../../models/builder/Module_Setup"; +import { Observable } from "rxjs"; +import { ApiRequestService } from "../api/api-request.service"; +import { HttpParams } from "@angular/common/http"; +@Injectable({ + providedIn: 'root' +}) +export class ModulesetupService { + private baseURL = "api/module-setup"; + private copyModuleURL = 'api/module-copy'; + private allrepourl ='api/getAllMyRepos'; + constructor( private apiRequest: ApiRequestService) { } + getAll(page?: number, size?: number): Observable { // not in use + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + //const _http = this.baseURL + '/all'; + return this.apiRequest.get(this.baseURL, params); + } + + getProjectModules(projectId:number, page?: number, size?: number): Observable { + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append("projectId", projectId.toString()); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + //const _http = this.baseURL + '/all'; + return this.apiRequest.get(this.baseURL, params); + } + + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + + getByAccountId(): Observable { + const _http = this.baseURL + "/user-menu"; + return this.apiRequest.get(_http); + } + + create(moduleSetup: ModuleSetup): Observable { + let params: HttpParams = new HttpParams(); + // params = params.append("p_id", projectId.toString()); + return this.apiRequest.post(this.baseURL, moduleSetup); + } + + update(id: number, moduleSetup: ModuleSetup): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, moduleSetup); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + copy(moduleCopyForm: Object) :Observable { + return this.apiRequest.post(this.copyModuleURL, moduleCopyForm); + } + + getByallrepouserId(id: number): Observable { + const _http = this.allrepourl + "/" + id; + return this.apiRequest.get(_http); + } + + + + /////backend Configuration + + saveData(data: any): Observable { + return this.apiRequest.post(`BackendConfig/BackendConfig`, data); + } + + getDetails(): Observable { + return this.apiRequest.get(`BackendConfig/BackendConfig`); + } + + getDetailsById(id: number): Observable { + return this.apiRequest.get(`BackendConfig/BackendConfig/${id}`); + } + + deleteById(id: number): Observable { + return this.apiRequest.delete(`BackendConfig/BackendConfig/${id}`); + } + + updatebackend(data: any, id: number): Observable { + return this.apiRequest.put(`BackendConfig/BackendConfig/${id}`, data); + } + + getAllViaModule(module_id: number): Observable { + return this.apiRequest.get(`BackendConfig/moduleid/${module_id}`); + } + + getAllViaProject(project_id: number): Observable { + return this.apiRequest.get(`BackendConfig/by_project/${project_id}`); + } + + + /////Database Configuration + + saveDBData(data: any): Observable { + return this.apiRequest.post(`Dbconfig/Dbconfig`, data); + } + + getDBDetails(): Observable { + return this.apiRequest.get(`Dbconfig/Dbconfig`); + } + + getDBDetailsById(id: number): Observable { + return this.apiRequest.get(`Dbconfig/Dbconfig/${id}`); + } + + deleteDBById(id: number): Observable { + return this.apiRequest.delete(`Dbconfig/Dbconfig/${id}`); + } + + updateDB(data: any, id: number): Observable { + return this.apiRequest.put(`Dbconfig/Dbconfig/${id}`, data); + } + + getDBAllViaModule(moduleid: number): Observable { + return this.apiRequest.get(`Dbconfig/bymoduleid/${moduleid}`); + } + + getDBAllViaProject(project_id: number): Observable { + return this.apiRequest.get(`Dbconfig/by_proj_id/${project_id}`); + } + + + testConnection(databaseType: string, username: string, password: string, portnumber: string, dbhostname: string, database_name): Observable{ + const url = 'suredata/test/testconnection'; + let params: HttpParams = new HttpParams(); + params =params.append("database_type",databaseType); + params =params.append("username",username); + params =params.append("password",password); + params =params.append("portnumber",portnumber); + params =params.append("dbhostname",dbhostname); + params =params.append("database_name",database_name) + return this.apiRequest.get(url, params); + } + + + //////get all config + + getConfigById(moduleid: number): Observable { + return this.apiRequest.get(`fnd/project/getallconfig/${moduleid}`); + } + + //==============Module_library===============// + +// copyToLibrary(id: number): Observable { +// return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}`); +// } + +copyFromLibrary(library_id: number, proj_id: number): Observable { + return this.apiRequest.get(`library/modulelibrary/copyfrommodulelibrarytomodule/${library_id}/${proj_id}`); +} + + +addToLibrary(id: number): Observable { + return this.apiRequest.get(`library/modulelibrary/copyfromrn_module/${id}`); +} + +getdetails(): Observable { + return this.apiRequest.get(`Wf_library/Wf_library`); +} + +getLibrarydetails(): Observable { + return this.apiRequest.get(`library/modulelibrary/getall_module_lib`); +} +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/project-setup.service.spec.ts b/frontend/angular-clarity-master/src/app/services/builder/project-setup.service.spec.ts new file mode 100644 index 0000000..cfc90bb --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/project-setup.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { ProjectSetupService } from './project-setup.service'; + +describe('ProjectSetupService', () => { + let service: ProjectSetupService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(ProjectSetupService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/builder/project-setup.service.ts b/frontend/angular-clarity-master/src/app/services/builder/project-setup.service.ts new file mode 100644 index 0000000..dc32c4b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/project-setup.service.ts @@ -0,0 +1,237 @@ + +import { Injectable } from '@angular/core'; +import { ProjectSetup } from "../../models/builder/Project_setup"; +import { forkJoin, Observable } from "rxjs"; +import { ApiRequestService } from "../api/api-request.service"; +import { HttpParams } from "@angular/common/http"; +import { HttpClient} from '@angular/common/http'; +import { map } from 'rxjs/operators'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class ProjectSetupService { + private baseURL = "api/project-setup"; + //private copyProjectURL = 'api/project-list'; + private copyProjectURL = 'api/project-copy'; + private recenmodiurl = 'api/getAllRecentPrjs'; + private recentarchivedurl = 'api/getAllArchivedPrjs'; + private allfavurl='api/getAllFavPrjsdet'; + private getalluserid='api/GetAllByUserId'; + private addboardandprourl='api/addBoardClmnsOther'; + private getrepourl ='api/getmodulename'; + private copydeployurl='api/Git_copy'; + data: any; + obj:any; + private storage: Storage = sessionStorage; + constructor(private apiRequest: ApiRequestService, + private http: HttpClient) { this.getAll().subscribe(data => {}, error => console.log(error)); + localStorage.setItem('project',JSON.stringify(this.data)); + } + + getAll(page?: number, size?: number): Observable { + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + //const _http = this.baseURL + '/all'; + return this.apiRequest.get(this.baseURL, params); + } + getallmyproject(): Observable{ + return this.apiRequest.get(`fnd/project/myproject`); + } +getalljson(){ + + return this.http.get('../assets/data/data.json').pipe + (map(data => { + this.data = data; + console.log(data); + }, err => { + if (err) { + return err.json(); + } + })); + return this.apiRequest.get(this.baseURL); +} + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + + + create(projectSetup: ProjectSetup): Observable { + return this.apiRequest.post(this.baseURL, projectSetup); + } + + update(id: number, projectSetup: ProjectSetup): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, projectSetup); + } + + copy(projectCopyForm: Object) :Observable { + return this.apiRequest.post(this.copyProjectURL, projectCopyForm); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + +//recently modify + getallrecentmodify(id: number): Observable { + const _http = this.recenmodiurl + "/" + id; + return this.apiRequest.get(_http); + } + getallrecentarchived(id:number): Observable{ + const _http = this.recentarchivedurl + "/" + id; + return this.apiRequest.get(_http); + } + getallfav(id:number): Observable{ + const _http = this.allfavurl + "/" + id; + return this.apiRequest.get(_http); + } + getallsharedwithme(): Observable{ + return this.apiRequest.get(`workspace/secworkspaceuser/sharedwithme`); + } + getallbyuserid(id:number): Observable{ + const _http = this.getalluserid + "/" + id; + return this.apiRequest.get(_http); + } + public sample(data1,data2): Observable{ + let call1=this.apiRequest.post(this.baseURL, data1) + let call2=this.apiRequest.post(this.addboardandprourl,data2) + return forkJoin([call1, call2]); +} + +getprojectname(){ + return this.http.get(`${baseUrl}/api/getprojectname`); +} +getreponame(projectId:any,page?: number, size?: number){ + let params: HttpParams = new HttpParams(); + params = params.append("projectId", projectId.toString()); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + return this.apiRequest.get(this.getrepourl, params); + //return this.http.get(`${baseUrl}/api/getmodulename`,params); +} +getmilstonename(){ + return this.http.get(`${baseUrl}/milestonename`); +} +getiterationname(){ + return this.http.get(`${baseUrl}/iterationname`); +} +getgoalname(){ + return this.http.get(`${baseUrl}/goalname`); +} +getpmusername(){ + return this.http.get(`${baseUrl}/pmusername`); +} +getallteam(){ + return this.http.get(`${baseUrl}/Sec_team`); +} +getallreport(){ + return this.http.get(`${baseUrl}/Report_to`); +} +getallassign(){ + return this.http.get(`${baseUrl}/Assign`); +} +getallrequestor(){ + return this.http.get(`${baseUrl}/Requestor`); +} +getallowner(){ + return this.http.get(`${baseUrl}/Owner`); +} +getalltype(){ + return this.http.get(`${baseUrl}/DD_type`); +} + +public build(Id: any){ + return this.apiRequest.get(`entityBuilder/BuildByProject/${Id}`); +} +private pdata: string = "pdata"; +public storeaddeditvalues(pdata:any,) { + this.storage.setItem(this.pdata,JSON.stringify (pdata)); + //console.log(this.data); +} +getdata(): any { + //console.log(this.data); + var pdata = JSON.parse(this.storage.getItem(this.pdata)); + //let data = this.storage.getItem(this.data); + return pdata; +} +copydeployment(projectId:any,deployment:any,msg: any,newprojectname:any,repo_cond:any){ + let params: HttpParams = new HttpParams(); + params =params.append("copy_from",projectId); + params =params.append("Deployment_profile",deployment); + params =params.append("commit_msg",msg); + params =params.append("newproject_name",newprojectname), + params=params.append("repo_cond",repo_cond) + return this.http.post(`${baseUrl}/api/Git_copy`,params); + //return this.apiRequest.post(this.copydeployurl,params); + //return this.http.get(`${baseUrl}/api/getmodulename`,params); + +} +private gitiareponame: string = "data"; +public storeaddedgitiareponame(data:any,) { + this.storage.setItem(this.gitiareponame,JSON.stringify (data)); + //console.log(this.data); +} +getgitiareponame(): any { + //console.log(this.data); + var data = JSON.parse(this.storage.getItem(this.gitiareponame)); + //let data = this.storage.getItem(this.data); + return data; +} +public removereponame() { + this.storage.removeItem(this.gitiareponame); +} +private repoIdKey: any; +public storereposhaid(sha:any) { + this.storage.setItem(this.repoIdKey,sha.toString()); +} +public removereposhaid() { + this.storage.removeItem(this.repoIdKey); +} +getreposhaid(): number { + this.removereposhaid(); + let repoId = +this.storage.getItem(this.repoIdKey); + return repoId; +} + + + //==============project_library===============// + +// copyToLibrary(id: number): Observable { +// return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}`); +// } + +copyFromLibrary(id: number): Observable { + return this.apiRequest.get(`projectlibrary/copyfromprojectlibrary/${id}`); +} + +getallprojectLibrary(): Observable { + return this.apiRequest.get(`projectlibrary/getall_projectlibrary`); +} + + +addToLibrary(id: number): Observable { + return this.apiRequest.get(`projectlibrary/copyfromrn_project/${id}`); +} + +getdetails(): Observable { + return this.apiRequest.get(`Wf_library/Wf_library`); +} + + + +/////////////////////////filters================================ +getAllSearchResults(keyword: string): Observable { + const url = `fnd/project/search/${keyword}`; + return this.apiRequest.get(url); +} + + +//////technology show +getProjectTechbyId(proj_id: number): Observable { + return this.apiRequest.get(`fnd/project2/techstacks/${proj_id}`); +} +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/technology-stack.service.ts b/frontend/angular-clarity-master/src/app/services/builder/technology-stack.service.ts new file mode 100644 index 0000000..347c139 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/technology-stack.service.ts @@ -0,0 +1,80 @@ + +import { Injectable } from '@angular/core'; +import { ActiveTechnology } from '../../models/builder/ActiveTechnology'; +import { Bcf_TechnologyStack } from '../../models/builder/Bcf_TechnologyStack'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../../services/api/api-request.service'; +import { HttpParams } from '@angular/common/http'; +@Injectable({ + providedIn: 'root' +}) +export class TechnologyStackService { + private technologyStackURL = 'api/technology-stack'; + private technologyStackURL1='api/technology_stack1'; + private technologyStackActivateURL ='api/tech-stack-active'; + private activatedTechnologyURL ='api/active-technology'; +private updateelementurl='api/update_tech_element' + constructor(private apiRequest: ApiRequestService) { } + getAll(page?: number, size?: number): Observable { + //Create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + // get all + // return this.apiRequest.get('api/instructors'); + // paginated data + return this.apiRequest.get(this.technologyStackURL, params); + + } + + getById(id: number): Observable { + const _http = this.technologyStackURL + "/" + id; + return this.apiRequest.get(_http); + } + + create(Bcf_TechnologyStack: Bcf_TechnologyStack): Observable { + //`${this.baseURL}` + return this.apiRequest.post(this.technologyStackURL, Bcf_TechnologyStack); + } + + // UPLOAD ZIP FILE DATA + saveFormAndUploadFile(formData: FormData) :Observable { + return this.apiRequest.postFormData(this.technologyStackURL, formData); + } +// without zip data save +saveFormAndUploadFile1(formData: FormData) :Observable { + return this.apiRequest.postFormData(this.technologyStackURL1, formData); +} +updateLineById(id:number,data:any){ + let _http = this.updateelementurl + "/"+id; + return this.apiRequest.put(_http,data); +} + update(id: number, Bcf_TechnologyStack: Bcf_TechnologyStack): Observable { + const _http = this.technologyStackURL + "/" + id; + return this.apiRequest.put(_http, Bcf_TechnologyStack); + } + + setActive(id: any):Observable { + let params: HttpParams = new HttpParams(); + params = params.append("id", id.toString()); + return this.apiRequest.get(this.technologyStackActivateURL, params); + } + + getActiveTechnology(): Observable { + return this.apiRequest.get(this.activatedTechnologyURL); + } + + delete(id: number): Observable { + const _http = this.technologyStackURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + ////get by service type + getByServiceType(servicetype: any): Observable { + const _http = "token/flf/tech_stack/get_byservicetype/" + servicetype; + return this.apiRequest.get(_http); + } + +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/wireframe-line.service.ts b/frontend/angular-clarity-master/src/app/services/builder/wireframe-line.service.ts new file mode 100644 index 0000000..f1bfe8b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/wireframe-line.service.ts @@ -0,0 +1,60 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import baseUrl from '../api/helper' +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class WireframeLineService { + + constructor(private _http: HttpClient, private apiRequest:ApiRequestService) { } + public addToDB(line: any){ + return this._http.post(`${baseUrl}/r/create`, line); + } + + public getOneFromDBById(id: any){ + return this._http.get(`${baseUrl}/r/get-one/${id}`); + } + + public getAllLines(){ + return this._http.get(`${baseUrl}/r/get-all`); + } + + public updateOneLine(line: any){ + return this._http.put(`${baseUrl}/r/update`, line); + } + getseedetails(): Observable { + return this._http.get(`${baseUrl}/token/frontendtable/getall`); + } +///list builder +getAllwireframeslistoflistbuilder(id:number):Observable{ + return this._http.get(`${baseUrl}/listbuilder/lb_line/getallwireframe_table/${id}`); +} + +////wireframe + getAllwireframeslist(id:number):Observable{ + return this._http.get(`${baseUrl}/formdrag/wireframe/getallwireframe_table/${id}`); + } + ///// + + getAllwireframes(id:number,wfid:any):Observable{ + return this._http.get(`${baseUrl}/formdrag/wireframe/getall_table/${id}/${wfid}`); + } + + getAllwireframesmodel(id:number,wfid:any,wfname:any):Observable{ + return this._http.get(`${baseUrl}/formdrag/wireframe/getmodel/${id}/${wfid}/${wfname}`); + } + + getColumnList(projId: any, tableName: any): Observable { + const url = `${baseUrl}/formdrag/wireframe/columnlistofwireframe/${projId}/${tableName}`; + return this._http.get(url); + } + +//==============wf_library===============// + +addToLibrary(id: number): Observable { + return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}`); +} + +} diff --git a/frontend/angular-clarity-master/src/app/services/builder/wireframe.service.ts b/frontend/angular-clarity-master/src/app/services/builder/wireframe.service.ts new file mode 100644 index 0000000..ecb926d --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/builder/wireframe.service.ts @@ -0,0 +1,273 @@ +import { HttpParams } from "@angular/common/http"; +import { Injectable } from "@angular/core"; +import { Rn_Fb_Header } from "src/app/models/builder/Rn_Fb_Header"; +import { Rn_Fb_Lines } from "src/app/models/builder/Rn_Fb_Lines"; +import { WireFrame } from "src/app/models/builder/WireFrame"; +import { Observable } from "rxjs"; +import { ApiRequestService } from "../api/api-request.service"; + +export interface WireFrameList { + id: number; + name: string; +} + +@Injectable() +export class WireframeService { + private wireframeBaseURL ='api/wireframe'; + private wireFrameDropDownURL = 'api/wireframe-list' + private wireFrameLinesURL = 'api/wireframe-lines' // used in edit view form + private uinamechangeurl='api/wireframe-uiname' + + private wireFrameLineURL = 'api/wireframe-line' // get fbLine by id + private copyWireFrameURL = 'api/wireframe-copy'; + private projectIdKey: string = "projectId"; // used in wireframe type component + private moduleIdKey: string = "moduleId"; + //private editWireframeCardURL = 'wfb/newupdate/headersnew'; //update wireframe card component list + + private storage: Storage = sessionStorage; + constructor( + private apiRequest: ApiRequestService + ) {} + + public storeProjectId(projectId: number) { + this.storage.setItem(this.projectIdKey, projectId.toString()); + } + public removeProjectId() { + this.storage.removeItem(this.projectIdKey); + } + getProjectId(): number { + let prjId = +this.storage.getItem(this.projectIdKey); + return prjId; + } + + public storeModuleId(moduleId: number) { + this.storage.setItem(this.moduleIdKey, moduleId.toString()); + } + public removeModuleId() { + this.storage.removeItem(this.moduleIdKey); + } + getModuleId(): number { + let modId = +this.storage.getItem(this.moduleIdKey); + return modId; + } + // ====== storage finish ======= + + // ========== RB_FB_HEADER APIS =========== // + + getAll(moduleId: number, page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + params = params.append("moduleId", moduleId.toString()); + // get all + return this.apiRequest.get(this.wireframeBaseURL, params); + } + + getById(id: number): Observable { + const _http = this.wireframeBaseURL + "/" + id; + return this.apiRequest.get(_http); + } + + // this is used in edit view form + getLinesByHeaderId(id: number): Observable { + const _http = this.wireFrameLinesURL + "/" + id; + return this.apiRequest.get(_http); + } + + create(fbHeader: Rn_Fb_Header,): Observable { + //`${this.baseURL}` + //let params: HttpParams = new HttpParams(); + // params = params.append("moduleId", moduleId.toString()); + //params = params.append("formType", formType); + return this.apiRequest.post(this.wireframeBaseURL, fbHeader); + } + + update(id: number, fbHeader: Rn_Fb_Header): Observable { + const _http = this.wireframeBaseURL + "/" + id; + return this.apiRequest.put(_http, fbHeader); + } + + wireFrameDropDown() : Observable { + return this.apiRequest.get(this.wireFrameDropDownURL); + } + + copy(wireframeCopyForm: Object) :Observable { + return this.apiRequest.post(this.copyWireFrameURL, wireframeCopyForm); + } + + // ======== RN FB LINE APIS =============// + getLineById(id: number): Observable { + const _http = this.wireFrameLineURL + "/" + id; + return this.apiRequest.get(_http); + } + + updateLineById(id: number, fbLine: Rn_Fb_Lines): Observable { + const _http = this.wireFrameLineURL + "/" + id; + return this.apiRequest.put(_http, fbLine); + } + + + // create table for only-header, header-line, only-line, multiline form + private createTableUrl: string = 'api/createTable'; + private createHLTableUrl: string = 'api/createTableHL'; + private createMLTableUrl: string = 'api/createTableMultiline'; + createTable(headerId: number, formType: string, data: Object) { + let params: HttpParams = new HttpParams(); + params = params.append("header_id", headerId.toString()); + + if(formType === 'header_only' || formType === 'line_only') { + return this.apiRequest.post(this.createTableUrl, data, params); + } else if (formType === 'header_line') { + return this.apiRequest.post(this.createHLTableUrl, data, params); + } else if(formType === 'multiline') { + return this.apiRequest.post(this.createMLTableUrl, data, params); + } + } + + + private buildMVCFormURL: string = 'api/build_wireframe'; + private buildForm: string ='api/SpringMVC_Hibernate_Mysql_Form_onlyHeader_Builder'; + private buildMVC_ML_FormURL: string = 'ml_build_form'; + // build mvc form + buildMVCForm(formType: string, headerId: number) { + let params: HttpParams = new HttpParams(); + params = params.append("header_id", headerId.toString()); + if(formType === 'multiline') { + return this.apiRequest.get(this.buildMVC_ML_FormURL, params); + } else { + return this.apiRequest.get(this.buildMVCFormURL, params); + // return this.apiRequest.get(this.buildForm, params); + } + } + + private buildAngularFormURL: string = 'build_angular_form'; + // build angular form + buildAngularForm(headerId: number) { + let params: HttpParams = new HttpParams(); + params = params.append("header_id", headerId.toString()); + return this.apiRequest.get(this.buildAngularFormURL, params); + } + + private delete_MVC_OH_FormURL: string = 'delete_wireframe'; + private delete_MVC_OL_FormURL: string = 'delete_line_wireframe'; + private delete_MVC_HL_FormURL: string = 'delete_header_line_wireframe'; + private delete_MVC_ML_FormURL: string = 'delete_header_line_wireframe'; + deleteMVCForm(formType: string, headerId: number) { + let params: HttpParams = new HttpParams(); + params = params.append("header_id", headerId.toString()); + if(formType === 'header_only') { + return this.apiRequest.get(this.delete_MVC_OH_FormURL, params); + } else if(formType === 'line_only') { + return this.apiRequest.get(this.delete_MVC_OL_FormURL, params); + } else if (formType === 'header_line') { + return this.apiRequest.get(this.delete_MVC_HL_FormURL, params); + } else if(formType === 'multiline') { + return this.apiRequest.get(this.delete_MVC_ML_FormURL, params); + } + } + + private baseURl: string = 'api'; + dynamicBuilder(headerId: number, actionLink: string) { + let params: HttpParams = new HttpParams(); + params = params.append("header_id", headerId?.toString()); + return this.apiRequest.get("api/wireframe_builder_json_controller"+actionLink, params); // first return this.apiRequest.get("api/"+actionLink, params); + } + public build(Id: any){ + return this.apiRequest.get(`entityBuilder/json/${Id}`); + } + //============= MANUPULATE WIREFRAME PROPERTIES ===============// + + private addNewFieldInSectionURL = 'api/wireframe-add-field-in-section'; + private addNewFieldInLineSectionURL = 'api/wireframe-add-field-in-line-section'; + private updateFieldNameURL = 'api/wireframe-update-field-name'; + private deleteSectionURL = 'api/wireframe-delete-section'; + addFieldInSection(id: number, sectionNumber: number) :Observable { + let params: HttpParams = new HttpParams(); + params = params.append("id", id.toString()); + params = params.append("section", sectionNumber.toString()); + return this.apiRequest.get(this.addNewFieldInSectionURL, params); + } + + addFieldInLineSection(id: number, sectionNumber: number): Observable { + let params: HttpParams = new HttpParams(); + params = params.append("id", id.toString()); + params = params.append("section", sectionNumber.toString()); + return this.apiRequest.get(this.addNewFieldInLineSectionURL, params); + } + + + updateFieldName(id: number, body: Rn_Fb_Lines): Observable { + let _http = this.updateFieldNameURL + "/" + id; + return this.apiRequest.post(_http, body); + } + + private addSectionOrButtonURL = 'api/wireframe-add-section-button'; + addSectionOrButton(headerId, body: Object): Observable { + let _http = this.addSectionOrButtonURL + "/" + headerId; + return this.apiRequest.post(_http, body); + } + + + deleteSection(headerId: number, sectionNumber: number): Observable { + let _http = this.deleteSectionURL + "/" + headerId; + let params: HttpParams = new HttpParams(); + params = params.append("section_num", sectionNumber.toString()); + return this.apiRequest.get(_http, params); + } + + private deleteFieldURL = 'api/wireframe_delete_header'; + deleteField(id: number) { + let _http = this.deleteFieldURL + "/" + id; + return this.apiRequest.delete(_http); + } + + updateuiname(id, data): Observable { + let _http = this.uinamechangeurl + "/" + id; + return this.apiRequest.put(_http,data); + } +private WURL='fnd/project/count_wfline3' +wireframecount(){ + let _http = this.WURL; + return this.apiRequest.get(_http); +} +wireframecount1(id:any){ + let _http = `fnd1/count/get_wireframe/${id}`; + return this.apiRequest.get(_http); +} +reportcount(id:any){ + let _http=`fnd1/count/get_REPORT/${id}`; + return this.apiRequest.get(_http); +} +actioncount(id:any){ + let _http=`fnd1/count/get_action/${id}`; + return this.apiRequest.get(_http); +} + +editWireframeCard(id:any, headerData:Rn_Fb_Header):Observable{ + const _http = `wfb/newupdate/headersnew/${id}`; + return this.apiRequest.put(_http,headerData); +} + +getByIdWireframe(id:any){ + let _http = `api/wireframe/${id}`; + return this.apiRequest.get(_http); +} + +//==============wf_library===============// + +// copyToLibrary(id: number): Observable { +// return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}`); +// } + +copyFromLibrary(id: number, moduleId: number): Observable { + return this.apiRequest.get(`wflibrary/copylib/copy_library/${id}/${moduleId}`); +} + +getdetails(): Observable { + return this.apiRequest.get(`Wf_library/Wf_library`); +} + + +} diff --git a/frontend/angular-clarity-master/src/app/services/csv.service.ts b/frontend/angular-clarity-master/src/app/services/csv.service.ts new file mode 100644 index 0000000..11af915 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/csv.service.ts @@ -0,0 +1,136 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { ApiRequestService } from "../services/api/api-request.service"; +import { HttpParams } from "@angular/common/http"; +import { saveAs } from 'file-saver'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import baseUrl from './api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class CsvService { + private getallheadersURL = "api/csv/getallheaders"; + private SaveURL = "api/template/save"; + private downloadURL = "api/csv/download"; + private purl="api/template/demo/download"; + constructor(private apiRequest: ApiRequestService, + private http: HttpClient) { } + + + importCsv(file: File,data:any):Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`${this.SaveURL}/${data}`,formData); + //return this.http.post('http://localhost:9191/api/csv/save', formData); + } + + getAllCsv(): Observable{ + let me = this; + let params: HttpParams = new HttpParams(); + //params = params.set('file', file); + return this.apiRequest.get(this.getallheadersURL, params); + } + + downloadCsv(): Observable{ + let me = this; + let params: HttpParams = new HttpParams(); + //params= params.set('file', file); + return this.apiRequest.get(this.downloadURL, params); + } + + // working + // downloadCsvsprio(data:any): void { + // this.http.get(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_priority2_t'); + // }); + // } + + // downloadCsvsprio(data:any): void { + // this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_priority2_t'); + // }); + // } + + // downloadCsvsimpa(data:any): void { + // this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_impact2_t'); + // }); + // } + // downloadCsvsurge(data:any): void { + // this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_urgency_t'); + // }); + // } + // downloadCsvscat(data:any): void { + // this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_category2_t'); + // }); + // } + // downloadCsvsstate(data:any): void { + // this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_State_t'); + // }); + // } + // downloadCsvscontact(data:any): void { + // this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_Contact_type_t'); + // }); + // } + // downloadCsvscust(data:any): void { + // this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_customer_t'); + // }); + // } + // downloadCsvshan(data:any): void { + // this.apiRequest.getFile(`${baseUrl}/api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + // saveAs(data, 'Sr_handler_t'); + // }); + // } + + downloadCsvs(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, data+'_t'); + }); + } + + downloadCsvsprio(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, 'Sr_priority2_t'); + }); + } + downloadCsvsimpa(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, 'Sr_impact2_t'); + }); + } + downloadCsvsurge(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, 'Sr_urgency_t'); + }); + } + downloadCsvscat(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, 'Sr_category2_t'); + }); + } + downloadCsvsstate(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, 'Sr_State_t'); + }); + } + downloadCsvscontact(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, 'Sr_Contact_type_t'); + }); + } + downloadCsvscust(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, 'Sr_customer_t'); + }); + } + downloadCsvshan(data:any): void { + this.apiRequest.getFile(`api/template/demo/download/${data}`, { responseType: 'blob' }).subscribe(data => { + saveAs(data, 'Sr_handler_t'); + }); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/excel.service.ts b/frontend/angular-clarity-master/src/app/services/excel.service.ts new file mode 100644 index 0000000..2c4c582 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/excel.service.ts @@ -0,0 +1,30 @@ +import { Injectable } from '@angular/core'; +import * as FileSaver from 'file-saver'; +import * as XLSX from 'xlsx'; + +const EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8'; +const EXCEL_EXTENSION = '.xlsx'; + +@Injectable({ + providedIn: 'root' +}) +export class ExcelService { + + constructor() { } + + public exportAsExcelFile(json: any[], excelFileName: string, fileNameSuffix=''): void { + + const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json); + const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] }; + const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' }); + this.saveAsExcelFile(excelBuffer, excelFileName, fileNameSuffix); + } + + private saveAsExcelFile(buffer: any, fileName = 'export', fileNameSuffix=''): void { + const data: Blob = new Blob([buffer], { + type: EXCEL_TYPE + }); + FileSaver.saveAs(data, fileName + fileNameSuffix + EXCEL_EXTENSION); + } + +} diff --git a/frontend/angular-clarity-master/src/app/services/fnd/alerts.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/alerts.service.ts new file mode 100644 index 0000000..430879a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/alerts.service.ts @@ -0,0 +1,68 @@ +import { Injectable } from '@angular/core'; +import { ApiRequestService } from '../api/api-request.service'; +import { Observable } from 'rxjs'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; + +@Injectable({ + providedIn: 'root' +}) +export class AlertsService { + + constructor(private http: HttpClient,private apiRequest: ApiRequestService) {} + + public saveData(data: any): Observable { + return this.apiRequest.post(`Alerts/Alerts`, data); + } + + public getDetails(): Observable { + return this.apiRequest.get(`Alerts/Alerts`); + } + + public getDetailsById(id: number): Observable { + return this.apiRequest.get(`Alerts/Alerts/${id}`); + } + + public deleteById(id: number): Observable { + return this.apiRequest.delete(`Alerts/Alerts/${id}`); + } + + public updateData(data: any, id: number): Observable { + return this.apiRequest.put(`Alerts/Alerts/${id}`, data); + } + + + ////////// ALert Rules + public saveRuleData(data: any): Observable { + return this.apiRequest.post(`AlertRules/AlertRules`, data); + } + + public getRuleDetails(): Observable { + return this.apiRequest.get(`AlertRules/AlertRules`); + } + + public getRuleDetailsById(id: number): Observable { + return this.apiRequest.get(`AlertRules/AlertRules/${id}`); + } + + public deleteRuleById(id: number): Observable { + return this.apiRequest.delete(`AlertRules/AlertRules/${id}`); + } + + public updateRuleData(data: any, id: number): Observable { + return this.apiRequest.put(`AlertRules/AlertRules/${id}`, data); + } + + ///get table form store + public getTablefromstore(id: number): Observable { + return this.apiRequest.get(`AlertRules/tablelist/${id}`); + } + + ///get column form store + public getColumnfromstore(id: number, tableName:string): Observable { + return this.apiRequest.get(`AlertRules/columnlist/${id}/${tableName}`); + } + + public getColumnfromurl(url: any): Observable { + return this.apiRequest.get(`chart/getAllKeys?apiUrl=${url}`); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/fnd/bulkimport.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/bulkimport.service.ts new file mode 100644 index 0000000..6055e4b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/bulkimport.service.ts @@ -0,0 +1,160 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { ApiRequestService } from '../api/api-request.service'; +import baseUrl from '../api/helper'; +import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; +import { map } from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root' +}) +export class BulkimportService { + private URL = environment.backendUrl; + constructor(private http: HttpClient,private apiRequest: ApiRequestService) { } + + public saveData(data: any): Observable { + return this.http.post(`${baseUrl}/BulkUpload/BulkUpload`, data); + } + + public getDetails(): Observable { + return this.http.get(`${baseUrl}/BulkUpload/BulkUpload`); + } + + public getDetailsById(id: number): Observable { + return this.http.get(`${baseUrl}/BulkUpload/BulkUpload/${id}`); + } + + public deleteById(id: number): Observable { + return this.http.delete(`${baseUrl}/BulkUpload/BulkUpload/${id}`); + } + + public updateData(data: any, id: number): Observable { + return this.http.put(`${baseUrl}/BulkUpload/BulkUpload/${id}`, data); + } + + + //rule + condition:string = ''; + setCondition(condition: string) { + this.condition = condition; + } + + getCondition(): string { + return this.condition; + } + + getSheetName(id: number): Observable{ + return this.apiRequest.get(`api/BulkUpload/sheet/${id}`); + } + + convertFileToJson(id: number): Observable { + return this.apiRequest.post(`api/BulkUpload/templatetojson/${id}`, {}); + } + + // getTemplateById(id: number): Observable { + // const url = `api/template/gettemplatebyid/${id}`; + // return this.apiRequest.get(url); + // } + + getHeader(id: number): Observable { + const url = `api/BulkUpload/getHeaders/${id}`; + return this.apiRequest.get(url); + } + + getColumnNames(tableName: string): Observable { + const url = `api/BulkUpload/columns/${tableName}`; + return this.apiRequest.get(url); + } + + changeKeysOfJson(updatedKeyJson: string, oldKeyDataJson:any): Observable { + const formData:FormData=new FormData(); + formData.append("updatedKeyJson",updatedKeyJson); + formData.append("oldKeyDataJson",oldKeyDataJson); + return this.apiRequest.postFormData(`api/BulkUpload/jsonkeychange`, formData); + } + + downloadExcel(id: string, jsonData:any, ruleData:any): Observable { + // return this.apiRequest.post(`api/dynamic/DownloadExcel/${tableName}`, data); + jsonData = JSON.stringify(jsonData); + ruleData = JSON.stringify(ruleData); + const formData:FormData=new FormData(); + formData.append("jsonData",jsonData); + formData.append("ruleData",ruleData); + const url = `${this.URL}/api/BulkUpload/DownloadExcel/${id}`; + return this.apiRequest.postFormData(`api/BulkUpload/DownloadExcel/${id}`, formData); + // return this.http.post(url, formData, { responseType: 'blob' }).pipe( + // map((response: Blob) => { + // // Process the response as needed + // return response; + // }) + // ); + } + + ////for download + getSheet(id: number): Observable { + const url = `${this.URL}/api/BulkUpload/downloadImportStatement/${id}`; + // return this.apiRequest.get(url); + return this.http.get(url, { responseType: 'blob' }).pipe( + map((response: Blob) => { + // Process the response as needed + return response; + }) + ); + } + + /////////////////////// + //mapping rules + public saveMappingData(data: any): Observable { + return this.http.post(`${baseUrl}/MappingRule/MappingRule`, data); + } + + public getMappingDetails(): Observable { + return this.http.get(`${baseUrl}/MappingRule/MappingRule`); + } + + public getMappingDetailsById(id: number): Observable { + return this.http.get(`${baseUrl}/MappingRule/MappingRule/${id}`); + } + + public deleteMappingById(id: number): Observable { + return this.http.delete(`${baseUrl}/MappingRule/MappingRule/${id}`); + } + + public updateMappingData(data: any, id: number): Observable { + return this.http.put(`${baseUrl}/MappingRule/MappingRule/${id}`, data); + } + + getDDforMappingRule(excelFile:any, sheetName:string){ + console.log(sheetName,excelFile) + const formData:FormData=new FormData(); + formData.append("excelFile",excelFile); + formData.append("sheetName",sheetName); + return this.apiRequest.postFormData(`MappingRule/getHeaders`, formData); + } + + + ///////////////////// + // master + + mastergetexcelSheet(file_type: string): Observable { + const url = `masterimport/demo/download/${file_type}`; + return this.apiRequest.get(url); + } + + masterdownloadExcel(id: string, jsonData:any,): Observable { + jsonData = JSON.stringify(jsonData); + const formData:FormData=new FormData(); + formData.append("jsonData",jsonData); + return this.apiRequest.postFormData(`masterimport/DownloadExcelForMaster/${id}`, formData); + } + + mastergetSheetName(id: number): Observable{ + return this.apiRequest.get(`masterimport/sheet/${id}`); + } + + mastergetColumnNames(tableName: string): Observable { + const url = `masterimport/columns/${tableName}`; + return this.apiRequest.get(url); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/fnd/code-extraction.service.spec.ts b/frontend/angular-clarity-master/src/app/services/fnd/code-extraction.service.spec.ts new file mode 100644 index 0000000..bd7eae4 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/code-extraction.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { CodeExtractionService } from './code-extraction.service'; + +describe('CodeExtractionService', () => { + let service: CodeExtractionService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(CodeExtractionService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/fnd/code-extraction.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/code-extraction.service.ts new file mode 100644 index 0000000..17b8dbd --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/code-extraction.service.ts @@ -0,0 +1,184 @@ +import { Injectable } from '@angular/core'; +import { HttpParams } from '@angular/common/http'; + + +import { Bcf_Extractor } from 'src/app/models/fnd/Bcf_Extractor'; +import { Bcf_Extractor_Params } from 'src/app/models/fnd/Bcf_Extractor_Params'; +import { FileData } from 'src/app/models/builder/FileData'; +import { FileDetails } from 'src/app/models/builder/FileDetails'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; +import { catchError } from 'rxjs/operators'; +@Injectable({ + providedIn: 'root' +}) +export class CodeExtractionService { + private codeExtractionURL = 'api/bcf-extractor'; + private codeExtractionParamsURL = 'api/bcf-extractor-params'; + private staticCodeExtractionURL = 'api/static_code_extraction'; + private dynamicCodeExtractionURL = 'api/dynamic_code_extraction'; + private buildMasterBuilderURL = 'api/build_master_builder'; + private extractionStatusChangeURL = 'api/bcf-extractor-params/extraction-status-change'; + private creationStatusChangeURL = 'api/bcf-extractor-params/creation-status-change'; + private codeExtractionBuilderURL = 'codeextractor/builderfile'; + + constructor(private apiRequest: ApiRequestService) { } + getAll(page?: number, size?: number): Observable { + //Create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + // get all + // return this.apiRequest.get('api/instructors'); + // paginated data + return this.apiRequest.get(this.codeExtractionURL, params); + } + + getById(id: number): Observable { + const _http = this.codeExtractionURL + "/" + id; + return this.apiRequest.get(_http); + } + + create(bcf_extractor: Bcf_Extractor): Observable { + //`${this.baseURL}` + return this.apiRequest.post(this.codeExtractionURL, bcf_extractor); + } + + // UPLOAD ZIP FILE DATA + saveFormAndUploadFile(formData: FormData) :Observable { + //return this.http.post(this.appConfig.baseApiPath + this.codeExtractionURL, formData, { reportProgress:true, observe: 'events' }); + return this.apiRequest.postFormData(this.codeExtractionURL, formData); + } + delete1(id: number): Observable { + const _http = this.codeExtractionURL + "/" + id; + return this.apiRequest.delete(_http); + } + update(id: number, bcf_extractor: Bcf_Extractor): Observable { + const _http = this.codeExtractionURL + "/" + id; + return this.apiRequest.put(_http, bcf_extractor); + } + + // =========== CODE EXTRACTION PARAMS =============== + + getCodeExtractionParamById(id: number): Observable { + const _http = this.codeExtractionParamsURL + "/" + id; + return this.apiRequest.get(_http); + } + getCodeExtractionParams(header_id: number): Observable { + let params: HttpParams = new HttpParams(); + params = params.append('header_id', header_id.toString()); + return this.apiRequest.get(this.codeExtractionParamsURL, params); + } + delete(id: number): Observable { + const _http = this.codeExtractionParamsURL + "/" + id; + return this.apiRequest.delete(_http); + } + createExtractionParams(header_id: number, bcf_extractor_params: Bcf_Extractor_Params): Observable { + let params: HttpParams = new HttpParams(); + params = params.append('header_id', header_id.toString()); + return this.apiRequest.post(this.codeExtractionParamsURL, bcf_extractor_params, params); + } + + updateExtractionParams(id: number, header_id: number, bcf_extractor_params: Bcf_Extractor_Params): Observable { + let params: HttpParams = new HttpParams(); + params = params.append('header_id', header_id.toString()); + const _http = this.codeExtractionParamsURL + "/" + id; + return this.apiRequest.put(_http, bcf_extractor_params, params); + } +updatecodeparam(id:any,bcf_extractor_params: Bcf_Extractor_Params):Observable{ + const _http = this.codeExtractionParamsURL + "/" + id; + return this.apiRequest.put(_http, bcf_extractor_params, ); +} + // CREATION STATUS CHANGE + + creationStatusChange(id: number): Observable { + let params: HttpParams = new HttpParams(); + params = params.append("id", id.toString()); + return this.apiRequest.get(this.creationStatusChangeURL, params); + } + // EXTRACTION STATUS CHANGE + extractionStatusChange(id: number): Observable { + let params: HttpParams = new HttpParams(); + params = params.append("id", id.toString()); + return this.apiRequest.get(this.extractionStatusChangeURL, params); + } + // STATIC CODE EXTRACTOPN AND DYNAMIC CODE EXTRACTION + staticCodeExtraction(id:number): Observable { + let params: HttpParams = new HttpParams(); + params = params.append('header_id', id.toString()); + return this.apiRequest.get(this.staticCodeExtractionURL, params); + } + dynamicCodeExtraction(id:number): Observable { + let params: HttpParams = new HttpParams(); + params = params.append('header_id', id.toString()); + return this.apiRequest.get(this.dynamicCodeExtractionURL, params); + } + + // BUILD MASTER BUILDER + buildMasterBuilder(id: number): Observable { + let params: HttpParams = new HttpParams(); + params = params.append('id', id.toString()); + return this.apiRequest.get(this.buildMasterBuilderURL, params); + } + + // ========== code editor service ======= + + private codeExtractorFileListURL = 'api/bcf-extractor-file-list'; + private fileReadURL = 'api/file-code-read'; + private fileCodeSaveURL = 'api/file-code-save'; + + getFileList(id: number): Observable { + const _http = this.codeExtractorFileListURL + "/" + id; + return this.apiRequest.get(_http); + + } + + readFile(id: number): Observable { + const _http = this.fileReadURL + "/" + id; + return this.apiRequest.get(_http); + } + saveCodeIntoFile(fileData: FileData): Observable { + return this.apiRequest.post(this.fileCodeSaveURL, fileData); + } + + // ======= STATIC CODE READ AND SAVE ========== // + private staticFileReadURL = 'api/static-file-code-read'; + private SstaticFileCodeSaveURL = 'api/static-file-code-save'; + readStaticFile(id: number): Observable { + const _http = this.staticFileReadURL + "/" + id; + return this.apiRequest.get(_http); + } + + saveCodeIntoStaticFile(fileData: FileData): Observable { + return this.apiRequest.post(this.SstaticFileCodeSaveURL, fileData); + } + + // ======= CODE EXTRACTION BUILDER ========== // + getCodeExtractionBuilderById(id: number): Observable { + // const _http = this.codeExtractionBuilderURL + "/" + id; + return this.apiRequest.get(`${this.codeExtractionBuilderURL}/getbyid/${id}`); + } + + getAllFileById(id: number):Observable{ + const url = `${this.codeExtractionBuilderURL}/get_allfile/${id}`; + return this.apiRequest.get(url); + } + + deleteBuiilderFile(id: number): Observable { + const _http = `${this.codeExtractionBuilderURL}/deletefile/${id}`; + return this.apiRequest.delete(_http); + } + + readBuidlerFile(id: number): Observable { + const _http = `${this.codeExtractionBuilderURL}/readfile/${id}`; + return this.apiRequest.get(_http); + } + + saveBuidlerFile(fileDetails: FileDetails): Observable { + return this.apiRequest.post('codeextractor/builderfile/savefile', fileDetails); + } + + +} + diff --git a/frontend/angular-clarity-master/src/app/services/fnd/dataflow.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/dataflow.service.ts new file mode 100644 index 0000000..24da09b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/dataflow.service.ts @@ -0,0 +1,123 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import baseUrl from 'src/app/services/api/helper'; +import { environment } from 'src/environments/environment'; +import { ApiRequestService } from '../api/api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class DataflowService { + // baseurl = environment.surejobUrl; + private addDataURl = 'api/suredata'; + constructor(private _http: HttpClient,private apiRequest: ApiRequestService) { } + public getAll() { + return this._http.get(`${baseUrl}/dataflow/dataflow`); + } + public create(data: any){ + return this._http.post(`${baseUrl}/dataflow/dataflow`, data); + } + create1(data:any,files:any): Observable { + const s = JSON.stringify(data); + const formData:FormData = new FormData(); + formData.append("data",s); + formData.append("ssh_file_key",files); + // for(let i=0;i{ + return this._http.get(`${baseUrl}/suredata/suredataflow/tablelistfromsource/${id}`); + } + public getstoredata(id:number):Observable{ + return this._http.get(`${baseUrl}/suredata/suredataflow/tablelistfromstore/${id}`); + } + public delete(id:any){ + return this._http.delete(`${baseUrl}/dataflow/dataflow/${id}`); + } + + public update(id:any,data:any){ + return this._http.put(`${baseUrl}/dataflow/dataflow/${id}`, data); + } + public updatelines(id:any,data:any){ + return this._http.put(`${baseUrl}/dataflow/dataflow_line/update/${id}`,data); + } + // public getdataflowlines(){ + // return this._http.get(`${baseUrl}/dataflow/dataflow_line/getall`); + // } + + + condition:string = ''; + setCondition(condition: string) { + this.condition = condition; + } + + getCondition(): string { + return this.condition; + } + + datacondition: string = ''; + setDataCondition(condition: string) { + this.datacondition = condition; + } + + getDataCondition(): string { + return this.datacondition; + } + + + public createjob(id:any):Observable { + return this._http.get(`${baseUrl}/token/suredata/surejob/create_job/${id}`); + } + //surebilljob + // public getAllsurejob(line_id:any) { + // return this._http.get(`${this.baseurl}/surebilljob/getalljob/${line_id}`); + // } + // public createsceduler(data: any){ + // return this._http.post(`${this.baseurl}/surebilljob/schedule`, data); + // } + // public updatesurejob(data: any){ + // return this._http.post(`${this.baseurl}/surebilljob/schedule`, data); + // } + // public pause(data:any){ + // return this._http.post(`${this.baseurl}/surebilljob/pauseschedule`, data); + // } + // public runonce(data:any){ + // return this._http.post(`${this.baseurl}/surebilljob/runschedule`, data); + // } + // public resume(data:any){ + // return this._http.post(`${this.baseurl}/surebilljob/resumeschedule`, data); + // } + // public deletesurejob(val:any){ + // return this._http.delete(`${this.baseurl}/surebilljob/deleteschedule/${val}`,); + // } + + /////////////// data flow 3 /////////////// + + getColumnListFromSourceTable(id: number, tableName: string): Observable { + return this.apiRequest.get(`suredata/suredataflow3/columnlistfromSource/${id}/${tableName}`); + } + getColumnListFromStoreTable(id: number, tableName: string): Observable { + return this.apiRequest.get(`suredata/suredataflow3/columnlistfromStore/${id}/${tableName}`); + } + /////cron jobs ////////////// + buildCronJob(minutes: string, hours: string, dayOfMonth: string, month: string, dayOfWeek: string): string { + const cronJobString = `${minutes} ${hours} ${dayOfMonth} ${month} ${dayOfWeek}`; + return cronJobString; + } + + + ///////////data flow table name by store name////////// + getTableListFromStoreByName(name: string): Observable { + const url = `${baseUrl}/suredata/suredataflow/tablelistfromstoreByname/${name}`; + return this._http.get(url); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/services/fnd/datamanagement.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/datamanagement.service.ts new file mode 100644 index 0000000..6bd5436 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/datamanagement.service.ts @@ -0,0 +1,111 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; +import { map } from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root' +}) +export class DatamanagementService { + private URL = environment.backendUrl; + private updateUrl = "api/template/dynamic/dynamic_temp" + constructor(private apiRequest: ApiRequestService, private _http: HttpClient) { } + getall() { + return this.apiRequest.get(`api/template/getalltemplate`); + } + + // getallentity(){ + // return this.apiRequest.get(`api/template/databasequery/Table_list_all`); + // } + + getTemplateById(id: number): Observable { + const url = `api/template/gettemplatebyid/${id}`; + return this.apiRequest.get(url); + } + + getHeader(id: number): Observable { + const url = `api/dynamic/getHeaders/${id}`; + return this.apiRequest.get(url); + } + + getColumnNames(tableName: string): Observable { + const url = `api/dynamic/columns/${tableName}`; + return this.apiRequest.get(url); + } + + // create(data:any,files:any): Observable { + // const s = JSON.stringify(data); + // const formData:FormData = new FormData(); + // formData.append("data",s); + // formData.append("file",files); + + // return this.apiRequest.postFormData(`sureserve/template/dynamic/dynamic_temp`,formData); + // } + + create(file: any, fileType: string): Observable { + const formData: FormData = new FormData(); + formData.append('file', file); + // let params: HttpParams = new HttpParams(); + // params =params.append('fileType', fileType); + return this.apiRequest.postFormData(`api/template/save/${fileType}`, formData); + } + + update(id: number, data: any, files: any): Observable { + const s = JSON.stringify(data); + const formData: FormData = new FormData(); + formData.append("data", s); + formData.append("file", files); + return this.apiRequest.postFormData(`${this.updateUrl}/${id}`, formData); + } + + delete(id: any) { + return this.apiRequest.delete(`api/template/deletetemplate/${id}`); + } + + // getjson(){ + // return this.apiRequest.get(`api/dynamic/jsonkeychange`); + // } + + changeKeysOfJson(newjson: string, body: any): Observable { + // const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded'); + // let params: HttpParams = new HttpParams(); + // params =params.append('newjson', newJson); + // params =params.append('body', body); + const formData: FormData = new FormData(); + formData.append("newjson", newjson); + formData.append("body", body); + return this.apiRequest.postFormData(`api/dynamic/jsonkeychange`, formData); + } + + + saveTemplateInJson(id: any): Observable { + // const formData: FormData = new FormData(); + // formData.append('file', file); + // console.log(formData, file); + + // let params: HttpParams = new HttpParams(); + // params =params.append("file",file); + return this.apiRequest.get(`api/dynamic/templatetojson/${id}`); + } + + convertFileToJson(id: number): Observable { + return this.apiRequest.post(`api/dynamic/templatetojson/${id}`, {}); + } + + + downloadExcel(tableName: string, data: any): Observable { + // return this.apiRequest.post(`api/dynamic/DownloadExcel/${tableName}`, data); + const url = `${this.URL}/api/dynamic/DownloadExcel/${tableName}`; + return this._http.post(url, data, { responseType: 'blob' }).pipe( + map((response: Blob) => { + // Process the response as needed + return response; + }) + ); + } + + + +} diff --git a/frontend/angular-clarity-master/src/app/services/fnd/datastore.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/datastore.service.ts new file mode 100644 index 0000000..9368540 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/datastore.service.ts @@ -0,0 +1,109 @@ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import baseUrl from 'src/app/services/api/helper'; +import { ApiRequestService } from '../api/api-request.service'; +@Injectable({ + providedIn: 'root' +}) +export class DatastoreService { + private addDataURl = 'api/suredata'; + private addDataURl1='api/suredatasource'; + constructor(private _http: HttpClient,private apiRequest: ApiRequestService) { } + public getAll() { + return this._http.get(`${baseUrl}/api/suredata`); + } + public create(data: any){ + return this._http.post(`${baseUrl}/api/suredata`, data); + } + create1(data:any,files:any): Observable { + const s = JSON.stringify(data); + const formData:FormData = new FormData(); + formData.append("data",s); + formData.append("ssh_file_key",files); + // for(let i=0;i { + const s =JSON.stringify(data); + const formData:FormData=new FormData(); + formData.append("data",s); + formData.append("ssh_file_key",files); + + return this.apiRequest.postFormData(`${this.addDataURl}/${id}`,formData); + + + } + public getAll2() { + return this._http.get(`${baseUrl}/api/suredatasource`); + } + + create2(data:any,files:any): Observable { + const s = JSON.stringify(data); + const formData:FormData = new FormData(); + formData.append("data",s); + formData.append("ssh_file_key",files); + // for(let i=0;i { + const s =JSON.stringify(data); + const formData:FormData=new FormData(); + formData.append("data",s); + formData.append("ssh_file_key",files); + + return this.apiRequest.postFormData(`${this.addDataURl1}/${id}`,formData); + } + + testConnection(databaseType: string, storeUsername: string, storePassword: string, portNumber: string, dbHostname: string, databasename): Observable{ + const url = 'suredata/test/testconnection'; + let params: HttpParams = new HttpParams(); + params =params.append("database_type",databaseType); + params =params.append("store_username",storeUsername); + params =params.append("store_password",storePassword); + params =params.append("portnumber",portNumber); + params =params.append("dbhostname",dbHostname); + params =params.append("database_name",databasename) + return this.apiRequest.get(url, params); + } + + testsshConnection(sshHost: string, sshUsername: string, sshPassword: string, sshKeyFile: any): Observable{ + const url = 'suredata/test/checksshconnection'; + let params: HttpParams = new HttpParams(); + params =params.append("sshHost",sshHost); + params =params.append("sshUsername",sshUsername); + params =params.append("sshPassword",sshPassword); + params =params.append("sshKeyFile",sshKeyFile); + return this.apiRequest.post(url, params); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/fnd/exception-rule-library.service.spec.ts b/frontend/angular-clarity-master/src/app/services/fnd/exception-rule-library.service.spec.ts new file mode 100644 index 0000000..22ba84b --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/exception-rule-library.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { ExceptionRuleLibraryService } from './exception-rule-library.service'; + +describe('ExceptionRuleLibraryService', () => { + let service: ExceptionRuleLibraryService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(ExceptionRuleLibraryService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/fnd/exception-rule-library.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/exception-rule-library.service.ts new file mode 100644 index 0000000..5bfda6e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/exception-rule-library.service.ts @@ -0,0 +1,42 @@ +import { HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { Bcf_Exception_Rule_Library } from 'src/app/models/fnd/Bcf_Exception_Rule_Library '; +import { ApiRequestService } from '../api/api-request.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ExceptionRuleLibraryService { + private exceptionRuleLibraryBaseURL = 'codeextractor/exception/exception'; + constructor(private apiRequest: ApiRequestService) { } + getAll(): Observable { + return this.apiRequest.get(this.exceptionRuleLibraryBaseURL); + //Create Request URL params + // let params: HttpParams = new HttpParams(); + // params = params.append("page", typeof page === "number" ? page.toString() : "0"); + // params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + // return this.apiRequest.get(this.exceptionRuleLibraryBaseURL, params); + } + + getById(id: number): Observable { + const _http = this.exceptionRuleLibraryBaseURL + "/" + id; + return this.apiRequest.get(_http); + } + + save(exception_rule: Bcf_Exception_Rule_Library): Observable { + return this.apiRequest.post(this.exceptionRuleLibraryBaseURL, exception_rule); + } + + update(id: number, exception_rule: Bcf_Exception_Rule_Library): Observable { + const _http = this.exceptionRuleLibraryBaseURL + "/" + id; + return this.apiRequest.put(_http, exception_rule); + } + + delete(id: number): Observable { + const _http = this.exceptionRuleLibraryBaseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + +} diff --git a/frontend/angular-clarity-master/src/app/services/fnd/extension.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/extension.service.ts new file mode 100644 index 0000000..33bab08 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/extension.service.ts @@ -0,0 +1,78 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from '../api/api-request.service'; +import { HttpParams} from "@angular/common/http"; +import { ExtensionField } from 'src/app/models/fnd/ExtensionField'; +@Injectable({ + providedIn: 'root' +}) +export class ExtensionService { + private extensionAPI = 'api/extension'; + private extensionBuildAPI = 'api/extension_build'; + private lookupAPI = 'api/lookup_values'; + private dataTypeAPI = 'api/datatypes'; + constructor(private apiRequest: ApiRequestService) { } +​ + getAll(page?:number, size?:number): Observable { + //Create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append('page', typeof page === "number"? page.toString():"0"); + params = params.append('size', typeof size === "number"? size.toString():"1000"); + return this.apiRequest.get(this.extensionAPI, params); +​ +} +​ +getById(id: number) :Observable { + return this.apiRequest.get(this.extensionAPI + '/' + id); +​ +} +​ +create(extensionField: Object) :Observable { + //`${this.baseURL}` + return this.apiRequest.post(this.extensionAPI, extensionField); +​ +} +​ +update(id: number, extensionField: ExtensionField) :Observable { + return this.apiRequest.put(this.extensionAPI + "/" + id, extensionField); +} +​ +// http://localhost:9119/api/extension_build?account_id=admin&form_code=teacher_form +// build extension +buildExtension(id:any, account_id?:any, form_code?:any): Observable { + let params: HttpParams = new HttpParams(); + params = params.append('account_id', account_id.toString()); + params = params.append('form_code', form_code.toString()); + + const url = `api/extension_build/${id}` + return this.apiRequest.get(url, params); +} +​ +// look up code (attribute, flex) +getLookupValues() :Observable { + return this.apiRequest.get(this.lookupAPI); +} +​ +// datatypes code (string, varchar, int etc) +getDataTypeValues() :Observable { + return this.apiRequest.get(this.dataTypeAPI); +} +delete(id:any){ + return this.apiRequest.delete(`api/extension/${id}`); +} +​ +​ +​ +///extension build json object +​ +getDetailsByFormCode(formCode: string): Observable { + const url = `FromExtensionJsonExtensionJson/${formCode}`; + return this.apiRequest.get(url); + } +​ + getJsonObjectsByFormCodeList(formCode: string): Observable { + const url = `FromExtensionJson/ListExtensionJson/${formCode}`; + return this.apiRequest.get(url); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/services/fnd/rule-library.service.spec.ts b/frontend/angular-clarity-master/src/app/services/fnd/rule-library.service.spec.ts new file mode 100644 index 0000000..057e7bf --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/rule-library.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { RuleLibraryService } from './rule-library.service'; + +describe('RuleLibraryService', () => { + let service: RuleLibraryService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(RuleLibraryService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/fnd/rule-library.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/rule-library.service.ts new file mode 100644 index 0000000..045f0c2 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/rule-library.service.ts @@ -0,0 +1,87 @@ +// import { Injectable } from '@angular/core'; + +// @Injectable({ +// providedIn: 'root' +// }) +// export class RuleLibraryService { + +// constructor() { } +// } + +import { HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { Bcf_Rule_Library } from 'src/app/models/fnd/Bcf_Rule_Library'; +import { RuleCopy, Rule } from 'src/app/models/fnd/RuleCopy'; +import { ApiRequestService } from '../api/api-request.service'; + +@Injectable({ + providedIn: 'root' +}) +export class RuleLibraryService { + private ruleLibraryBaseURL = 'code_extractor/rule_keyword/Rule_library_keyword'; + private copyRuleURL = 'api/rule-copy'; + private keywordurl='codeextractor/rulelib_new/rule_keyword1'; + private filedurl='codeextractor/rulelib_new/rule_keyword'; + private copyURL = 'code_extractor/rule_keyword/copyrule' + constructor(private apiRequest: ApiRequestService) { } + + copy(data: RuleCopy) { + return this.apiRequest.post(this.copyRuleURL, data); + } + + getAll(page?: number, size?: number): Observable { + //Create Request URL params + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + return this.apiRequest.get(this.ruleLibraryBaseURL, params); + } + + getById(id: number): Observable { + const _http = this.ruleLibraryBaseURL + "/" + id; + return this.apiRequest.get(_http); + } + + save(rule: Bcf_Rule_Library): Observable { + return this.apiRequest.post(this.ruleLibraryBaseURL, rule); + } + + update(id: number, rule: Bcf_Rule_Library): Observable { + const _http = this.ruleLibraryBaseURL + "/" + id; + return this.apiRequest.put(_http, rule); + } + delete(id: number): Observable { + const _http = this.ruleLibraryBaseURL + "/" + id; + return this.apiRequest.delete(_http); + } + keyword(id: number,keyword: any): Observable { + let params: HttpParams = new HttpParams(); + params = params.append("id", id.toString()); + params= params.append("keyword",keyword); + return this.apiRequest.get(this.keywordurl, params); + } + + insertfile(id:any,data:any,keyword:any,){ + let params: HttpParams = new HttpParams(); + params = params.append("id", id.toString()); + params= params.append("selectedarea",data); + params= params.append("keyword",keyword); + console.log(params); + return this.apiRequest.get(this.filedurl, params); + } + + copyRule(technologyStack: string, objectType: string, subObjectType: string, service: string, newTechStackName: string, rule: Rule){ + let params: HttpParams = new HttpParams(); + params =params.append("technology_stack",technologyStack); + params =params.append("object_type",objectType); + params =params.append("sub_object_type",subObjectType); + params =params.append("service",service), + params=params.append("new_tech_stack_name",newTechStackName) + return this.apiRequest.post(this.copyURL,rule,params); + //return this.apiRequest.post(this.copydeployurl,params); + //return this.http.get(`${baseUrl}/api/getmodulename`,params); + + } +} + diff --git a/frontend/angular-clarity-master/src/app/services/fnd/workflow-data.service.spec.ts b/frontend/angular-clarity-master/src/app/services/fnd/workflow-data.service.spec.ts new file mode 100644 index 0000000..7b38791 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/workflow-data.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { WorkflowDataService } from './workflow-data.service'; + +describe('WorkflowDataService', () => { + let service: WorkflowDataService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(WorkflowDataService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/fnd/workflow-data.service.ts b/frontend/angular-clarity-master/src/app/services/fnd/workflow-data.service.ts new file mode 100644 index 0000000..0c3ec49 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/fnd/workflow-data.service.ts @@ -0,0 +1,63 @@ + +import { Injectable } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams } from "@angular/common/http"; +import { Observable } from 'rxjs'; +import { ApiRequestService } from "src/app/services/api/api-request.service"; + +@Injectable({ + providedIn: 'root' +}) +export class WorkflowDataService { + private getAllURL = 'work'; + private addDataURl = 'work'; + private editDataURL = 'work'; + private deleteURL ='work'; + private getByIdURL = 'work'; + private updateWorkflowURL = 'updateByid'; + private fileurl ='/sureops/createfile'; + private callurl='workflow/workflow/callworkflow' + constructor(private _http: HttpClient, + private apiRequest: ApiRequestService) { } + getAll(page?: number, size?: number): Observable { + // create Request URL params + let me = this; + let params: HttpParams = new HttpParams(); + params = params.append("page", typeof page === "number" ? page.toString() : "0"); + params = params.append("size", typeof size === "number" ? size.toString() : "1000"); + // params = params.append("module_id", module_id.toString()); + // get all + return this.apiRequest.get(this.getAllURL, params); + } +getcallall(){ + return this.apiRequest.get(this.callurl); +} + create(data:any): Observable + { + return this.apiRequest.post(this.addDataURl, data); + } + + delete(id:number){ + let _http = this.deleteURL + "/" + id; + return this.apiRequest.delete(_http); + } + + getById(id:number) + { + let _http = this.getByIdURL + "/"+id; + return this.apiRequest.get(_http); + } + + updateLineById(id:number,data:any) + { + let _http = this.updateWorkflowURL + "/"+id; + return this.apiRequest.put(_http,data); + } + + update(id:number,data:any) + { + let _http = this.editDataURL + "/"+id; + return this.apiRequest.put(_http,data); + } + +} + diff --git a/frontend/angular-clarity-master/src/app/services/jwt.interceptor.ts b/frontend/angular-clarity-master/src/app/services/jwt.interceptor.ts new file mode 100644 index 0000000..257cd63 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/jwt.interceptor.ts @@ -0,0 +1,22 @@ +import { Injectable } from '@angular/core'; +import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { UserInfoService } from './user-info.service'; + +@Injectable() +export class JwtInterceptor implements HttpInterceptor { + constructor(private userInfoService: UserInfoService) {} + + intercept(request: HttpRequest, next: HttpHandler): Observable> { + // add authorization header with jwt token if available + let currentUser = this.userInfoService.getUserInfo(); + if (currentUser && currentUser.token) { + request = request.clone({ + setHeaders: { + Authorization: `Bearer ${currentUser.token}` + } + }); + } + return next.handle(request); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/services/main.service.spec.ts b/frontend/angular-clarity-master/src/app/services/main.service.spec.ts new file mode 100644 index 0000000..f8dc470 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/main.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { MainService } from './main.service'; + +describe('MainService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: MainService = TestBed.get(MainService); + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/angular-clarity-master/src/app/services/main.service.ts b/frontend/angular-clarity-master/src/app/services/main.service.ts new file mode 100644 index 0000000..9aaaa85 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/main.service.ts @@ -0,0 +1,36 @@ +import { Injectable } from '@angular/core'; +import { JwtHelperService } from '@auth0/angular-jwt'; +import { HttpClient } from '@angular/common/http'; + +@Injectable({ + providedIn: 'root' +}) +export class MainService { + token = sessionStorage.getItem('token'); + jwtHelper: JwtHelperService = new JwtHelperService(); + + constructor(private http: HttpClient) { } + + getIP() { + return this.http.get(`https://api.ipify.org?format=json`) + .toPromise() + .then(result => result) + .catch(error => error); + } + + getUser() { + // return this.http.get(`${this.url}/get-annouce/${month}/${year}`) + return this.http.get(`https://randomuser.me/api/?results=100`) + .toPromise() + .then(result => result) + .catch(error => error); + } + + getUserTest() { + return this.http.get(`https://randomuser.me/api/?results=100`) + .toPromise() + .then(result => result) + .catch(error => error); + } + +} diff --git a/frontend/angular-clarity-master/src/app/services/notification.service.ts b/frontend/angular-clarity-master/src/app/services/notification.service.ts new file mode 100644 index 0000000..5ddf252 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/notification.service.ts @@ -0,0 +1,36 @@ +import { Injectable } from '@angular/core'; +import { Subject } from 'rxjs'; + +export enum NotificationType { + Warning = "warning", + Info = "info", + Danger = "danger" +} + +export class Notification { + constructor( + public readonly type: NotificationType, + public readonly message: string, + public readonly detail: string) { + } +} + +@Injectable({ + providedIn: 'root' +}) +export class NotificationService { + private readonly _notifications = new Subject(); + + public readonly notifications = this._notifications.asObservable(); + + public add(notification: Notification) { + if (!notification.message || notification.message.trim() == ""){ + console.error("ERROR NOTIFICATION WITHOUT MESSAGE: " + notification) + } + this._notifications.next(notification); + } + + public flushNotification() { + this._notifications.next(null); + } +} diff --git a/frontend/angular-clarity-master/src/app/services/theme.service.ts b/frontend/angular-clarity-master/src/app/services/theme.service.ts new file mode 100644 index 0000000..b045c2e --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/theme.service.ts @@ -0,0 +1,326 @@ +import { Injectable } from '@angular/core'; +import { BehaviorSubject, Observable } from 'rxjs'; + +export interface ThemeColors { + primary: string; + secondary: string; + accent: string; + background: string; + surface: string; + text: string; + textSecondary: string; +} + +export interface Theme { + id: string; + name: string; + colors: ThemeColors; + borderRadius: string; + shadow: string; + fonts: { + primary: string; + secondary: string; + mono: string; + }; +} + +@Injectable({ + providedIn: 'root' +}) +export class ThemeService { + private currentThemeSubject = new BehaviorSubject(this.getDefaultTheme()); + public currentTheme$ = this.currentThemeSubject.asObservable(); + + private readonly STORAGE_KEY = 'cloudnsure-theme'; + + constructor() { + this.loadThemeFromStorage(); + } + + // Default theme + private getDefaultTheme(): Theme { + return { + id: 'default', + name: 'Default Blue', + colors: { + primary: '#0ea5e9', + secondary: '#64748b', + accent: '#8b5cf6', + background: '#f8fafc', + surface: '#ffffff', + text: '#1f2937', + textSecondary: '#6b7280' + }, + borderRadius: '0.5rem', + shadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)', + fonts: { + primary: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + secondary: 'Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + mono: 'JetBrains Mono, "Fira Code", Consolas, monospace' + } + }; + } + + // Predefined themes + getThemes(): Theme[] { + return [ + this.getDefaultTheme(), + { + id: 'purple', + name: 'Purple Dream', + colors: { + primary: '#8b5cf6', + secondary: '#64748b', + accent: '#ec4899', + background: '#faf5ff', + surface: '#ffffff', + text: '#1f2937', + textSecondary: '#6b7280' + }, + borderRadius: '0.75rem', + shadow: '0 10px 15px -3px rgba(139, 92, 246, 0.1)', + fonts: { + primary: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + secondary: 'Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + mono: 'JetBrains Mono, "Fira Code", Consolas, monospace' + } + }, + { + id: 'green', + name: 'Forest Green', + colors: { + primary: '#10b981', + secondary: '#64748b', + accent: '#f59e0b', + background: '#f0fdf4', + surface: '#ffffff', + text: '#1f2937', + textSecondary: '#6b7280' + }, + borderRadius: '0.375rem', + shadow: '0 10px 15px -3px rgba(16, 185, 129, 0.1)', + fonts: { + primary: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + secondary: 'Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + mono: 'JetBrains Mono, "Fira Code", Consolas, monospace' + } + }, + { + id: 'orange', + name: 'Sunset Orange', + colors: { + primary: '#f59e0b', + secondary: '#64748b', + accent: '#ef4444', + background: '#fffbeb', + surface: '#ffffff', + text: '#1f2937', + textSecondary: '#6b7280' + }, + borderRadius: '1rem', + shadow: '0 10px 15px -3px rgba(245, 158, 11, 0.1)', + fonts: { + primary: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + secondary: 'Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + mono: 'JetBrains Mono, "Fira Code", Consolas, monospace' + } + }, + { + id: 'dark', + name: 'Dark Mode', + colors: { + primary: '#3b82f6', + secondary: '#9ca3af', + accent: '#8b5cf6', + background: '#111827', + surface: '#1f2937', + text: '#f9fafb', + textSecondary: '#d1d5db' + }, + borderRadius: '0.5rem', + shadow: '0 10px 15px -3px rgba(0, 0, 0, 0.3)', + fonts: { + primary: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + secondary: 'Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', + mono: 'JetBrains Mono, "Fira Code", Consolas, monospace' + } + } + ]; + } + + // Get current theme + getCurrentTheme(): Theme { + return this.currentThemeSubject.value; + } + + // Apply theme + applyTheme(theme: Theme): void { + this.currentThemeSubject.next(theme); + this.saveThemeToStorage(theme); + this.updateCSSVariables(theme); + } + + // Select theme by ID + selectTheme(themeId: string): void { + const theme = this.getThemes().find(t => t.id === themeId); + if (theme) { + this.applyTheme(theme); + } + } + + // Update theme colors + updateThemeColors(colors: Partial): void { + const currentTheme = this.getCurrentTheme(); + const updatedTheme = { + ...currentTheme, + colors: { ...currentTheme.colors, ...colors } + }; + this.applyTheme(updatedTheme); + } + + // Update theme fonts + updateThemeFonts(fonts: Partial): void { + const currentTheme = this.getCurrentTheme(); + const updatedTheme = { + ...currentTheme, + fonts: { ...currentTheme.fonts, ...fonts } + }; + this.applyTheme(updatedTheme); + } + + // Update theme properties + updateThemeProperty(property: keyof Theme, value: any): void { + const currentTheme = this.getCurrentTheme(); + const updatedTheme = { + ...currentTheme, + [property]: value + }; + this.applyTheme(updatedTheme); + } + + // Reset to default theme + resetToDefault(): void { + this.applyTheme(this.getDefaultTheme()); + } + + // Export theme + exportTheme(): string { + return JSON.stringify(this.getCurrentTheme(), null, 2); + } + + // Import theme + importTheme(themeJson: string): boolean { + try { + const theme = JSON.parse(themeJson) as Theme; + if (this.validateTheme(theme)) { + this.applyTheme(theme); + return true; + } + return false; + } catch (error) { + console.error('Invalid theme JSON:', error); + return false; + } + } + + // Validate theme structure + private validateTheme(theme: any): theme is Theme { + return ( + theme && + typeof theme.id === 'string' && + typeof theme.name === 'string' && + theme.colors && + typeof theme.colors.primary === 'string' && + typeof theme.colors.secondary === 'string' && + typeof theme.colors.accent === 'string' && + typeof theme.colors.background === 'string' && + typeof theme.colors.surface === 'string' && + typeof theme.colors.text === 'string' && + typeof theme.colors.textSecondary === 'string' + ); + } + + // Update CSS custom properties + private updateCSSVariables(theme: Theme): void { + const root = document.documentElement; + + // Update color variables + root.style.setProperty('--theme-primary', theme.colors.primary); + root.style.setProperty('--theme-secondary', theme.colors.secondary); + root.style.setProperty('--theme-accent', theme.colors.accent); + root.style.setProperty('--theme-background', theme.colors.background); + root.style.setProperty('--theme-surface', theme.colors.surface); + root.style.setProperty('--theme-text', theme.colors.text); + root.style.setProperty('--theme-text-secondary', theme.colors.textSecondary); + + // Update other properties + root.style.setProperty('--theme-border-radius', theme.borderRadius); + root.style.setProperty('--theme-shadow', theme.shadow); + root.style.setProperty('--theme-font-primary', theme.fonts.primary); + root.style.setProperty('--theme-font-secondary', theme.fonts.secondary); + root.style.setProperty('--theme-font-mono', theme.fonts.mono); + + // Update body class for theme-specific styling + document.body.className = document.body.className.replace(/theme-\w+/g, ''); + document.body.classList.add(`theme-${theme.id}`); + } + + // Load theme from localStorage + private loadThemeFromStorage(): void { + try { + const stored = localStorage.getItem(this.STORAGE_KEY); + if (stored) { + const theme = JSON.parse(stored) as Theme; + if (this.validateTheme(theme)) { + this.currentThemeSubject.next(theme); + this.updateCSSVariables(theme); + } + } else { + // Apply default theme on first load + this.updateCSSVariables(this.getDefaultTheme()); + } + } catch (error) { + console.error('Error loading theme from storage:', error); + this.updateCSSVariables(this.getDefaultTheme()); + } + } + + // Save theme to localStorage + private saveThemeToStorage(theme: Theme): void { + try { + localStorage.setItem(this.STORAGE_KEY, JSON.stringify(theme)); + } catch (error) { + console.error('Error saving theme to storage:', error); + } + } + + // Get color presets for color picker + getColorPresets(): { name: string; value: string }[] { + return [ + { name: 'Blue', value: '#0ea5e9' }, + { name: 'Purple', value: '#8b5cf6' }, + { name: 'Green', value: '#10b981' }, + { name: 'Orange', value: '#f59e0b' }, + { name: 'Red', value: '#ef4444' }, + { name: 'Pink', value: '#ec4899' }, + { name: 'Indigo', value: '#6366f1' }, + { name: 'Teal', value: '#14b8a6' }, + { name: 'Yellow', value: '#eab308' }, + { name: 'Gray', value: '#64748b' } + ]; + } + + // Get font options + getFontOptions(): { name: string; value: string }[] { + return [ + { name: 'Inter', value: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' }, + { name: 'Poppins', value: 'Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' }, + { name: 'Roboto', value: 'Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif' }, + { name: 'Open Sans', value: '"Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' }, + { name: 'Lato', value: 'Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' }, + { name: 'Montserrat', value: 'Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' }, + { name: 'Source Sans Pro', value: '"Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' }, + { name: 'Nunito', value: 'Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' } + ]; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/services/user-info.service.ts b/frontend/angular-clarity-master/src/app/services/user-info.service.ts new file mode 100644 index 0000000..b9d3779 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/services/user-info.service.ts @@ -0,0 +1,122 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import baseUrl from './api/helper'; +export interface UserInStorage{ + userId:string; + email:string; + displayName:string; + username: string; + roles: string, + token:string; +} +export interface LoginInfoInStorage{ + success:boolean; + message:string; + landingPage:string; + user?:UserInStorage; +} +@Injectable() +export class UserInfoService { + + public currentUserKey:string="currentUser"; + public storage:Storage = sessionStorage; // <--- you may switch between sessionStorage or LocalStrage (only one place to change) + + + + constructor( private _http: HttpClient, + ) {} + + //Store userinfo from session storage + storeUserInfo(userInfoString:string) { + this.storage.setItem(this.currentUserKey, userInfoString); + } + + //Remove userinfo from session storage + removeUserInfo() { + this.storage.removeItem(this.currentUserKey); + } + + //Get userinfo from session storage + getUserInfo():UserInStorage|null { + try{ + let userInfoString:string = this.storage.getItem(this.currentUserKey); + if (userInfoString) { + let userObj:UserInStorage = JSON.parse(this.storage.getItem(this.currentUserKey)); + return userObj; + } + else{ + return null; + } + } + catch (e) { + return null; + } + } + + isLoggedIn():boolean { + return this.storage.getItem(this.currentUserKey)?true:false; + } + + //Get User's Display name from session storage + getUserName():string { + let userObj:UserInStorage = this.getUserInfo(); + if (userObj!== null) { + return userObj.displayName + } + return "no-user"; + } + + getEmail():string { + let userObj:UserInStorage = this.getUserInfo(); + if (userObj!== null) { + return userObj.email + } + return "no-user"; + } + + + getRoles(): string { + let userObj:UserInStorage = this.getUserInfo(); + if (userObj!== null) { + return userObj.roles + } + return null; + } + + + // Get User Id from session storage + getUserId(): string { + let userObj:UserInStorage = this.getUserInfo(); + if (userObj!== null) { + return userObj.userId; + } + return "no-user"; + } + + getStoredToken():string|null { + let userObj:UserInStorage = this.getUserInfo(); + if (userObj !== null) { + return userObj.token; + } + return null; + } + + public getAllUsers(){ + return this._http.get(`${baseUrl}/api/all-users`); + } + + public getUserById(id: any){ + return this._http.get(`${baseUrl}/api/get-one/${id}`); + } + + public updateUserById(id: any, user: any){ + return this._http.put(`${baseUrl}/api/org-users/${id}`, user); + } + + public deleteUserById(id: any){ + return this._http.delete(`${baseUrl}/api/org-users/${id}`); + } +public logout(){ + return this._http.get(`${baseUrl}/token/logout`); +} +} diff --git a/frontend/angular-clarity-master/src/app/shared/components/dynamic-form/dynamic-form.component.ts b/frontend/angular-clarity-master/src/app/shared/components/dynamic-form/dynamic-form.component.ts new file mode 100644 index 0000000..ee68c75 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/dynamic-form/dynamic-form.component.ts @@ -0,0 +1,89 @@ +import { Component, Input, Output, EventEmitter, ViewChild, ViewContainerRef, ComponentFactoryResolver } from '@angular/core'; +import { FieldConfig } from '../field-types/base-field.component'; +import { FieldFactoryService } from '../field-types/field-factory.service'; + +@Component({ + selector: 'app-dynamic-form', + template: ` +
+
+
+ +
+
+ +
+ + +
+
+ ` +}) +export class DynamicFormComponent { + @Input() fields: FieldConfig[] = []; + @Input() formData: any = {}; + @Input() formClass: string = 'sq-form'; + @Input() showActions: boolean = true; + @Input() submitText: string = 'Submit'; + @Input() cancelText: string = 'Cancel'; + @Input() submitIcon: string = 'check'; + + @Output() formSubmit = new EventEmitter(); + @Output() formCancel = new EventEmitter(); + + @ViewChild('fieldContainer', { read: ViewContainerRef }) fieldContainer: ViewContainerRef; + + isSubmitting = false; + + constructor( + private fieldFactory: FieldFactoryService, + private componentFactoryResolver: ComponentFactoryResolver + ) {} + + ngAfterViewInit() { + this.renderFields(); + } + + renderFields() { + this.fieldContainer.clear(); + + this.fields.forEach(field => { + this.fieldFactory.createField( + this.fieldContainer, + field.type, + field, + this.formData[field.name], + (value) => { + this.formData[field.name] = value; + } + ); + }); + } + + onSubmit() { + this.isSubmitting = true; + this.formSubmit.emit(this.formData); + } + + onCancel() { + this.formCancel.emit(); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/base-field.component.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/base-field.component.ts new file mode 100644 index 0000000..c0ca5fc --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/base-field.component.ts @@ -0,0 +1,25 @@ +import { Component, Input, Output, EventEmitter } from '@angular/core'; + +export interface FieldConfig { + name: string; + label: string; + type: string; + required?: boolean; + placeholder?: string; + validators?: any[]; + options?: any[]; + [key: string]: any; // For additional properties +} + +@Component({ + template: '' +}) +export class BaseFieldComponent { + @Input() field: FieldConfig; + @Input() value: any; + @Output() valueChange = new EventEmitter(); + + onChange(value: any) { + this.valueChange.emit(value); + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/field-factory.service.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/field-factory.service.ts new file mode 100644 index 0000000..4cd8b23 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/field-factory.service.ts @@ -0,0 +1,52 @@ +import { Injectable, ComponentFactoryResolver, ViewContainerRef } from '@angular/core'; +import { TextFieldComponent } from './text-field.component'; +import { NumberFieldComponent } from './number-field.component'; +import { PhoneFieldComponent } from './phone-field.component'; +import { ParagraphFieldComponent } from './paragraph-field.component'; +import { PasswordFieldComponent } from './password-field.component'; +import { TextareaFieldComponent } from './textarea-field.component'; +import { BaseFieldComponent } from './base-field.component'; + +@Injectable({ + providedIn: 'root' +}) +export class FieldFactoryService { + private componentMap: any = { + 'text': TextFieldComponent, + 'number': NumberFieldComponent, + 'phone': PhoneFieldComponent, + 'paragraph': ParagraphFieldComponent, + 'password': PasswordFieldComponent, + 'textarea': TextareaFieldComponent + }; + + constructor(private componentFactoryResolver: ComponentFactoryResolver) {} + + createField( + container: ViewContainerRef, + fieldType: string, + fieldConfig: any, + value: any, + valueChangeCallback: (value: any) => void + ): any { + const component = this.componentMap[fieldType]; + if (!component) { + throw new Error(`Unsupported field type: ${fieldType}`); + } + + const factory = this.componentFactoryResolver.resolveComponentFactory(component); + const componentRef = container.createComponent(factory); + + // Cast to BaseFieldComponent to access properties safely + const instance = componentRef.instance as BaseFieldComponent; + (instance as any).field = fieldConfig; + (instance as any).value = value; + + // Subscribe to value changes + if ((instance as any).valueChange && typeof (instance as any).valueChange.subscribe === 'function') { + (instance as any).valueChange.subscribe(valueChangeCallback); + } + + return componentRef; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/field-types.module.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/field-types.module.ts new file mode 100644 index 0000000..a3138f5 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/field-types.module.ts @@ -0,0 +1,44 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ClarityModule } from '@clr/angular'; + +import { BaseFieldComponent } from './base-field.component'; +import { TextFieldComponent } from './text-field.component'; +import { NumberFieldComponent } from './number-field.component'; +import { PhoneFieldComponent } from './phone-field.component'; +import { ParagraphFieldComponent } from './paragraph-field.component'; +import { PasswordFieldComponent } from './password-field.component'; +import { TextareaFieldComponent } from './textarea-field.component'; +import { DynamicFormComponent } from '../dynamic-form/dynamic-form.component'; + +@NgModule({ + declarations: [ + BaseFieldComponent, + TextFieldComponent, + NumberFieldComponent, + PhoneFieldComponent, + ParagraphFieldComponent, + PasswordFieldComponent, + TextareaFieldComponent, + DynamicFormComponent + ], + imports: [ + CommonModule, + FormsModule, + ReactiveFormsModule, + ClarityModule + ], + exports: [ + BaseFieldComponent, + TextFieldComponent, + NumberFieldComponent, + PhoneFieldComponent, + ParagraphFieldComponent, + PasswordFieldComponent, + TextareaFieldComponent, + DynamicFormComponent + ], + providers: [] +}) +export class FieldTypesModule { } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/field-types.scss b/frontend/angular-clarity-master/src/app/shared/components/field-types/field-types.scss new file mode 100644 index 0000000..4173f73 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/field-types.scss @@ -0,0 +1,364 @@ +// Shared field styles with modern UI enhancements following UI rules +.field-container { + margin-bottom: 24px; + position: relative; + animation: fadeInUp 0.3s ease-out; +} + +@keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(10px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +.sq-form-label { + display: flex; + align-items: center; + font-size: 14px; + font-weight: 600; + color: var(--theme-text); + margin-bottom: 8px; + font-family: var(--theme-font-primary); + letter-spacing: 0.02em; + + .label-text { + flex: 1; + } + + .required-indicator { + color: var(--theme-error, #ef4444); + margin-left: 6px; + font-size: 16px; + line-height: 1; + } +} + +.sq-form-input, +.sq-form-textarea { + width: 100%; + padding: 14px 16px; + font-size: 15px; + line-height: 1.5; + color: var(--theme-text); + background: var(--theme-surface); + border: 2px solid rgba(0, 0, 0, 0.08); + border-radius: 12px; + transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1); + margin-bottom: 0; + font-family: var(--theme-font-primary); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); + backdrop-filter: blur(10px); + + &:focus { + outline: none; + border-color: var(--theme-primary); + box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08); + background: var(--theme-surface); + transform: translateY(-2px); + } + + &:disabled { + background: var(--theme-background); + color: var(--theme-text-secondary); + cursor: not-allowed; + opacity: 0.7; + } + + &.error { + border-color: var(--theme-error, #ef4444); + box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); + animation: shake 0.5s ease-in-out; + } + + &::placeholder { + color: var(--theme-text-secondary); + font-style: italic; + opacity: 0.7; + } + + &:hover:not(:disabled):not(:focus) { + border-color: rgba(0, 0, 0, 0.15); + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); + transform: translateY(-1px); + } +} + +@keyframes shake { + 0%, 100% { transform: translateX(0); } + 25% { transform: translateX(-5px); } + 75% { transform: translateX(5px); } +} + +.sq-form-textarea { + min-height: 120px; + resize: vertical; + border-radius: 12px; +} + +.field-description { + color: var(--theme-text-secondary); + font-size: 13px; + margin-top: 8px; + font-style: italic; + line-height: 1.4; + display: flex; + align-items: flex-start; + + &::before { + content: "ℹ"; + margin-right: 6px; + font-size: 12px; + } +} + +.sq-error-message { + color: var(--theme-error, #ef4444); + font-size: 13px; + margin-top: 8px; + font-weight: 500; + display: flex; + align-items: center; + padding: 8px 12px; + background: rgba(239, 68, 68, 0.05); + border-radius: 8px; + border-left: 3px solid var(--theme-error, #ef4444); + + &::before { + content: "⚠"; + margin-right: 8px; + font-size: 16px; + } +} + +// Phone field specific styles +.phone-input-container { + position: relative; + display: flex; + align-items: center; + + .phone-input { + flex: 1; + border-radius: 12px; + padding-left: 100px; + } + + .country-code-selector { + position: absolute; + left: 2px; + top: 2px; + bottom: 2px; + display: flex; + align-items: center; + padding: 0 12px; + background: var(--theme-background); + border-radius: 10px 0 0 10px; + border-right: 1px solid rgba(0, 0, 0, 0.08); + z-index: 1; + cursor: pointer; + transition: all 0.2s ease; + + &:hover { + background: var(--theme-surface); + } + + .country-flag { + margin-right: 8px; + font-size: 18px; + } + + .country-code { + font-weight: 500; + color: var(--theme-text); + } + + .dropdown-icon { + margin-left: 6px; + transition: transform 0.2s ease; + } + } + + .country-code-btn { + margin-left: 8px; + min-width: 80px; + border-radius: 12px; + } +} + +// Password field specific styles with modern enhancements +.password-input-container { + position: relative; + display: flex; + + .password-input { + flex: 1; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right: none; + } + + .password-toggle { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border-left: none; + height: 48px; + background: var(--theme-background); + border: 2px solid rgba(0, 0, 0, 0.08); + transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1); + color: var(--theme-text-secondary); + display: flex; + align-items: center; + justify-content: center; + padding: 0 16px; + cursor: pointer; + + &:hover { + background: var(--theme-surface); + color: var(--theme-text); + } + + &:focus { + border-color: var(--theme-primary); + box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15); + outline: none; + } + + clr-icon { + width: 18px; + height: 18px; + } + } +} + +.password-strength { + display: flex; + align-items: center; + margin-top: 12px; + padding: 12px; + background: var(--theme-background); + border-radius: 12px; + transition: all 0.3s ease; + + &.weak { + background: rgba(239, 68, 68, 0.1); + border: 1px solid rgba(239, 68, 68, 0.2); + } + + &.medium { + background: rgba(245, 158, 11, 0.1); + border: 1px solid rgba(245, 158, 11, 0.2); + } + + &.strong { + background: rgba(16, 185, 129, 0.1); + border: 1px solid rgba(16, 185, 129, 0.2); + } + + .strength-meter { + flex: 1; + height: 10px; + background-color: #e5e7eb; + border-radius: 5px; + overflow: hidden; + margin-right: 16px; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + + .strength-bar { + height: 100%; + border-radius: 5px; + transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); + + &.weak { + background: linear-gradient(90deg, #ef4444 0%, #ef4444 100%); + width: 33%; + } + + &.medium { + background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%); + width: 66%; + } + + &.strong { + background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981); + width: 100%; + } + } + } + + .strength-label { + font-size: 13px; + font-weight: 600; + color: var(--theme-text-secondary); + min-width: 100px; + text-align: right; + + &.weak { + color: #ef4444; + } + + &.medium { + color: #f59e0b; + } + + &.strong { + color: #10b981; + } + } +} + +// Character count for text areas with modern styling +.character-count { + text-align: right; + font-size: 13px; + color: var(--theme-text-secondary); + margin-top: 8px; + font-weight: 500; + padding: 6px 12px; + background: var(--theme-background); + border-radius: 20px; + display: inline-block; + float: right; + transition: all 0.2s ease; + + &.warning { + color: #f59e0b; + background: rgba(245, 158, 11, 0.1); + } + + &.error { + color: #ef4444; + background: rgba(239, 68, 68, 0.1); + } +} + +// Enhanced input group for better visual hierarchy +.input-group { + position: relative; + margin-bottom: 24px; + + .input-group-prepend, + .input-group-append { + position: absolute; + top: 50%; + transform: translateY(-50%); + z-index: 2; + color: var(--theme-text-secondary); + padding: 0 12px; + } + + .input-group-prepend { + left: 12px; + } + + .input-group-append { + right: 12px; + } + + .input-with-addon { + padding-left: 40px; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/index.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/index.ts new file mode 100644 index 0000000..c1ec2f7 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/index.ts @@ -0,0 +1,8 @@ +export * from './base-field.component'; +export * from './text-field.component'; +export * from './number-field.component'; +export * from './phone-field.component'; +export * from './paragraph-field.component'; +export * from './password-field.component'; +export * from './textarea-field.component'; +export * from './field-factory.service'; \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/number-field.component.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/number-field.component.ts new file mode 100644 index 0000000..918e10c --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/number-field.component.ts @@ -0,0 +1,38 @@ +import { Component, Input } from '@angular/core'; +import { BaseFieldComponent, FieldConfig } from './base-field.component'; + +@Component({ + selector: 'app-number-field', + template: ` +
+ + +
+ {{ field.description }} +
+
+ {{ field.errorMessage }} +
+
+ ` +}) +export class NumberFieldComponent extends BaseFieldComponent { + @Input() field: FieldConfig; + @Input() value: number; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/paragraph-field.component.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/paragraph-field.component.ts new file mode 100644 index 0000000..6c1b157 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/paragraph-field.component.ts @@ -0,0 +1,43 @@ +import { Component, Input } from '@angular/core'; +import { BaseFieldComponent, FieldConfig } from './base-field.component'; + +@Component({ + selector: 'app-paragraph-field', + template: ` +
+ + +
+ {{ value?.length || 0 }}/{{ field.maxLength }} +
+
+ {{ field.description }} +
+
+ {{ field.errorMessage }} +
+
+ ` +}) +export class ParagraphFieldComponent extends BaseFieldComponent { + @Input() field: FieldConfig; + @Input() value: string; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/password-field.component.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/password-field.component.ts new file mode 100644 index 0000000..b39671f --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/password-field.component.ts @@ -0,0 +1,89 @@ +import { Component, Input } from '@angular/core'; +import { BaseFieldComponent, FieldConfig } from './base-field.component'; + +@Component({ + selector: 'app-password-field', + template: ` +
+ +
+ + +
+
+
+
+
+ {{ passwordStrengthLabel }} +
+
+ {{ field.description }} +
+
+ {{ field.errorMessage }} +
+
+ ` +}) +export class PasswordFieldComponent extends BaseFieldComponent { + @Input() field: FieldConfig; + @Input() value: string; + + isPasswordVisible = false; + + get passwordStrength(): number { + if (!this.value) return 0; + + let strength = 0; + if (this.value.length >= 8) strength += 25; + if (/[A-Z]/.test(this.value)) strength += 25; + if (/[0-9]/.test(this.value)) strength += 25; + if (/[^A-Za-z0-9]/.test(this.value)) strength += 25; + + return strength; + } + + get passwordStrengthLabel(): string { + const strength = this.passwordStrength; + if (strength < 25) return 'Very Weak'; + if (strength < 50) return 'Weak'; + if (strength < 75) return 'Medium'; + if (strength < 100) return 'Strong'; + return 'Very Strong'; + } + + getPasswordStrengthClass(): string { + const strength = this.passwordStrength; + if (strength < 25) return 'weak'; + if (strength < 50) return 'weak'; + if (strength < 75) return 'medium'; + return 'strong'; + } + + togglePasswordVisibility() { + this.isPasswordVisible = !this.isPasswordVisible; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/phone-field.component.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/phone-field.component.ts new file mode 100644 index 0000000..6483976 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/phone-field.component.ts @@ -0,0 +1,72 @@ +import { Component, Input } from '@angular/core'; +import { BaseFieldComponent, FieldConfig } from './base-field.component'; + +@Component({ + selector: 'app-phone-field', + template: ` +
+ +
+
+ 🇺🇸 + {{ selectedCountryCode }} + +
+ + +
+
+ {{ errorMessage }} +
+
+ {{ field.description }} +
+
+ ` +}) +export class PhoneFieldComponent extends BaseFieldComponent { + @Input() field: FieldConfig; + @Input() value: string; + + selectedCountryCode = '+91'; + errorMessage = ''; + + onPhoneChange(value: string) { + // Validate phone number format + if (this.field.pattern) { + const regex = new RegExp(this.field.pattern); + if (!regex.test(value)) { + this.errorMessage = this.field.errorMessage || 'Please enter a valid phone number'; + } else { + this.errorMessage = ''; + } + } + this.onChange(value); + } + + toggleCountryCodeSelector() { + // Implementation for country code selector + // This would typically open a modal or dropdown + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/text-field.component.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/text-field.component.ts new file mode 100644 index 0000000..e45be34 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/text-field.component.ts @@ -0,0 +1,43 @@ +import { Component, Input } from '@angular/core'; +import { BaseFieldComponent, FieldConfig } from './base-field.component'; + +@Component({ + selector: 'app-text-field', + template: ` +
+ + +
+ {{ field.description }} +
+
+ {{ value?.length || 0 }}{{ field.maxLength ? '/' + field.maxLength : '' }} +
+
+ {{ field.errorMessage }} +
+
+ ` +}) +export class TextFieldComponent extends BaseFieldComponent { + @Input() field: FieldConfig; + @Input() value: string; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/components/field-types/textarea-field.component.ts b/frontend/angular-clarity-master/src/app/shared/components/field-types/textarea-field.component.ts new file mode 100644 index 0000000..b51e29a --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/components/field-types/textarea-field.component.ts @@ -0,0 +1,43 @@ +import { Component, Input } from '@angular/core'; +import { BaseFieldComponent, FieldConfig } from './base-field.component'; + +@Component({ + selector: 'app-textarea-field', + template: ` +
+ + +
+ {{ value?.length || 0 }}/{{ field.maxLength }} +
+
+ {{ field.description }} +
+
+ {{ field.errorMessage }} +
+
+ ` +}) +export class TextareaFieldComponent extends BaseFieldComponent { + @Input() field: FieldConfig; + @Input() value: string; +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/app/shared/shared.module.ts b/frontend/angular-clarity-master/src/app/shared/shared.module.ts new file mode 100644 index 0000000..ae35a71 --- /dev/null +++ b/frontend/angular-clarity-master/src/app/shared/shared.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FieldTypesModule } from './components/field-types/field-types.module'; + +@NgModule({ + imports: [ + CommonModule, + FieldTypesModule + ], + exports: [ + FieldTypesModule + ] +}) +export class SharedModule { } \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/assets/.gitkeep b/frontend/angular-clarity-master/src/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/frontend/angular-clarity-master/src/assets/fonts/THSarabun Bold Italic.ttf b/frontend/angular-clarity-master/src/assets/fonts/THSarabun Bold Italic.ttf new file mode 100644 index 0000000..f286d7b Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/fonts/THSarabun Bold Italic.ttf differ diff --git a/frontend/angular-clarity-master/src/assets/fonts/THSarabun Bold.ttf b/frontend/angular-clarity-master/src/assets/fonts/THSarabun Bold.ttf new file mode 100644 index 0000000..4366b43 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/fonts/THSarabun Bold.ttf differ diff --git a/frontend/angular-clarity-master/src/assets/fonts/THSarabun BoldItalic.ttf b/frontend/angular-clarity-master/src/assets/fonts/THSarabun BoldItalic.ttf new file mode 100644 index 0000000..beb5249 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/fonts/THSarabun BoldItalic.ttf differ diff --git a/frontend/angular-clarity-master/src/assets/fonts/THSarabun Italic.ttf b/frontend/angular-clarity-master/src/assets/fonts/THSarabun Italic.ttf new file mode 100644 index 0000000..4be8ad8 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/fonts/THSarabun Italic.ttf differ diff --git a/frontend/angular-clarity-master/src/assets/fonts/THSarabun.ttf b/frontend/angular-clarity-master/src/assets/fonts/THSarabun.ttf new file mode 100644 index 0000000..23dd82b Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/fonts/THSarabun.ttf differ diff --git a/frontend/angular-clarity-master/src/assets/i18n/en.json b/frontend/angular-clarity-master/src/assets/i18n/en.json new file mode 100644 index 0000000..ba3c90f --- /dev/null +++ b/frontend/angular-clarity-master/src/assets/i18n/en.json @@ -0,0 +1,376 @@ + { + "BREADCRUMB_HOME": "Home", + "USER_GROUP_MAINTENANCE": "User Group Maintenance", + "BREADCRUMB_ABOUT_US": "About Us", + "ABOUT_TITLE": "About Us", + "SETUP": "Setup", + "SETUP_TOOLS": "Setup Tools", + "USER_MAINTENANCE": "User Maintenance", + "REPORTS": "Reports", + "REPORTS_DESCRIPTION": "Reports Description", + "ABOUT_DESCRIPTION": "Create new project for new users if you have access. If you don't have access, please contact the admin.", + "HOME": "Home", + "SECURITY": "Security", + "MENU_MAINTENANCE": "Menu Maintenance", + "MAIN_MENU": "Main Menu", + "DOWNLOAD_TEMPLATE": "Download Template", + "IMPORT": "Import", + "EXPORT_XLSX": "Export as XLSX", + "ADD": "Add", + + "MENU_ACCESS_CONTROL": "Menu Access Control", + "EDIT_MODE": "Edit Mode", + "FOR": "For", + "RELOAD": "Reload", + "SHOW_ALL": "Show All", + "ONLY_MAIN_MENU": "Only Main Menu", + + "NO_DATA_AVAILABLE": "No data available", + "NO": "No", + "MENU_ITEM_NAME": "Menu Item Name", + "VIEW": "View", + "CREATE": "Create", + "EDIT": "Edit", + "DELETE": "Delete", + "QUERY": "Query", + "EXPORT": "Export", + "SYNC": "Sync", + "editMode": "Edit Mode", + "setupCode": "Setup Code", + "value": "Value", + "schedulerTimer": "Scheduler Timer", + "schedulerTimerTooltip": "Time interval for scheduler", + "leaseTaxCode": "Lease Tax Code", + "taxCodeTooltip": "The tax code for the lease", + "vesselConfProcessLimit": "Vessel Configuration Process Limit", + "vesselConfProcessLimitTooltip": "Limit for the vessel configuration process", + "rowToDisplay": "Rows to Display", + "rowToDisplayTooltip": "Number of rows to display in the UI", + "linkToDisplay": "Link to Display", + "linkToDisplayTooltip": "URL to display on the page", + "rowToAdd": "Rows to Add", + "rowToAddTooltip": "Number of rows to add to the table", + "lovRowToDisplay": "LOV Rows to Display", + "lovRowToDisplayTooltip": "Rows for LOV (List of Values) to display", + "lovLinkToDisplay": "LOV Link to Display", + "lovLinkToDisplayTooltip": "URL for the LOV link", + "oidServerName": "OID Server Name", + "oidServerNameTooltip": "Name of the OID server", + "oidBase": "OID Base", + "oidBaseTooltip": "Base URL for OID", + "oidAdminUser": "OID Admin User", + "oidAdminUserTooltip": "Admin user for OID access", + "oidServerPort": "OID Server Port", + "oidServerPortTooltip": "Port number for the OID server", + + + "companyDisplayName": "Company Display Name", + "systemParameter": "System Parameter", + "userDefaultGroup": "User Default Group", + "defaultDepartment": "Default Department", + "defaultPosition": "Default Position", + "singleCharge": "Single Charge", + "firstDayOftheWeek": "First Day of The Week", + "hourPerShift": "Hour per Shift", + "cnBillingFrequency": "CN Billing Frequency", + "billingDepartmentCode": "Billing Department Code", + "basePriceList": "Base Price List", + "nonContainerServiceOrder": "Non-Container Service Order", + "ediMaeSchedulerONOFF": "EDI MAE Scheduler ON/OFF", + "ediSchedulerONOFF": "EDI Scheduler ON/OFF", + "uploadLogo": "Upload Logo", + "accessType": "Access Type", + "add": "ADD", + "modules": "Modules", + "loading": "Loading ...", + "name": "Name", + "default": "Default", + "description": "Description", + "addModules": "Add Modules", + "edit": "Edit", + "delete": "Delete", + "usersPerPage": "Users per page", + "of": "of", + "users": "users", + "addAccessType": "Add Access Type", + "cancel": "Cancel", + "areYouSureDelete": "Are You Sure Want to delete?", + "updateAccessType": "Update Access Type", + "update": "Update", + + "SEQ_GENERATOR": "Sequence Generator", + "CURRENT_NO": "Current No", + "NAME": "Name", + "PREFIX": "Prefix", + "SEPARATOR": "Separator", + "SEQUENCE_SIZE": "Sequence Size", + "REPORT": "Report", + "REPORT_RUNNER": "Report Runner", + + "REPORT_NAME": "Report Name", + "REPORT_DESCRIPTION": "Report Description", + "ACTIVE": "Active", + "FOLDER_NAME": "Folder Name", + "ACTION": "Action", + "SET_UP": "Set Up", + + "USERS_PER_PAGE": "Users per page", + "OF": "of", + "USERS": "users", + "ARE_YOU_SURE": "Are you sure you want to delete?", + "CANCEL": "Cancel", + "GO_TO": "Go To", + "ALL_REPORTS": "All Reports", + "ALL_REPORT": "All Report", + "REPORT_BUILDER_SQL": "Report Builder (SQL)", + "REPORT_BUILDER_URL": "Report Builder (URL)", + "LOADING_MESSAGE": "Dashboard could be found. Loading..", + "START_FROM_SCRATCH": "Start from scratch", + "IMPORT_TEMPLATE": "Import from a template", + "IMPORT_PUBLIC_PROJECT": "Import from public project", + "DELETE_CONFIRMATION": "Are You Sure Want to delete?", + + "LAST_UPDATED_ON": "Last Updated On:", + "CREATE_NEW_REPORT": "Create New Report", + "ADD_MODE": "Add Mode", + + "ENTER_NAME": "Enter name", + "DESCRIPTION": "Description", + "ENTER_DESCRIPTION": "Enter Description", + + "SUBMIT": "Submit", + "home": "Home", + "dashboard": "Dashboard", + "all_dashboard": "All Dashboard", + "dashboard_builder": "Dashboard Builder", + "dashboard_found": "Dashboard could be found. Loading..", + "loading": "Loading ...", + "last_updated": "Last Updated On", + "start_from_scratch": "Start from scratch", + "import_template": "Import from a template", + "import_public_project": "Import from public project", + "delete_confirmation": "Are You Sure Want to delete?", + "cancel": "Cancel", + "delete": "Delete", + "Dashboard_builder": "Dashboard Builder", + "Dashboard_runner": "Dashboard Runner", + "Go_to": "Go To", + "Dashboard_Name": "Dashboard Name", + "Description": "Description", + "Security_Profile": "Security Profile", + "Add_to_home": "Add to home", + "Action": "Action", + "Delete": "Delete", + "Who_Column": "Who Column", + "Account_ID": "Account ID", + "Created_At": "Created At", + "Created_By": "Created By", + "Updated_At": "Updated At", + "Updated_By": "Updated By", + "Start_from_scratch": "Start from scratch", + "Import_from_a_template": "Import from a template", + "Import_from_public_project": "Import from public project", + "Are_you_sure_to_delete": "Are you sure you want to delete?", + "define_dashboard": "Define Dashboard", + "add_mode": "Add Mode", + "dashboard_name_label": "Dashboard Name", + "dashboard_name_placeholder": "Enter Dashboard Name", + "security_profile_label": "Security Profile", + "security_profile_placeholder": "Enter Security Profile", + "description_label": "Description", + "description_placeholder": "Enter Description", + "add_to_dashboard_label": "Add to Dashboard", + "back_button": "BACK", + "submit_button": "SUBMIT", + "ACTIVITIES": "Activities", + "SUGGESTION_FOR_YOU": "Suggestion For You", + "LOADING": "Loading ...", + "NOTIFICATION_NOT_FOUND": "Notification could be found.", + "SUGGESTION_NOT_FOUND": "Suggestion could be found.", + "SERVICE": "Service", + "Last Updated On": "Last Updated On", + "REPORT_BUILDER_2": "Report Builder 2", + "REPORT_RUNNER": "Report Runner", + "ADD": "ADD", + "SET_UP": "SET UP", + "REPORT_NAME": "Report Name", + "REPORT_DESCRIPTION": "Report Description", + "ACTIVE": "Active", + "ACTION": "Action", + "DELETE": "Delete", + "WHO_COLUMN": "Who Column", + "ACCOUNT_ID": "Account ID", + "CREATED_AT": "Created At", + "CREATED_BY": "Created By", + "UPDATED_AT": "Updated At", + "UPDATED_BY": "Updated By", + "DELETE_CONFIRMATION": "Are You Sure Want to delete?", + "USERGROUP_NO": "User Group No", + "GROUP_NAME": "Group Name", + "GROUP_DESC": "Description", + "GROUP_LEVEL": "Group Level", + "STATUS": "Status", + "UPDATED_DATE": "Updated Date", + + "RECORDS_PER_PAGE": "Record per page", + "IMPORT_FILE": "Import File", + + "UPDATE": "Update", + "ARE_YOU_SURE_DELETE": "Are You Sure Want to delete?", + "THIS_FIELD_REQUIRED": "*This field is Required", + "NO": "No.", + "MENU_ITEM_NAME": "Menu Item Name", + "ID": "ID", + "SEQUENCE": "Sequence", + "MODULE_NAME": "Module Name", + "MENU_ACTION_LINK": "Menu Action Link", + "STATUS": "Status", + "SUB_MENU": "Sub Menu", + "video_Field2": "video_Field2", + "video_Field": "video_Field", + "numadd": "numadd", + "Support": "Support", + "about": "about", + "Button_Field2": "Button_Field2", + "autotest": "autotest", + "Childform": "Childform", + "Test2": "Test2", + "Chtes2": "Chtes2", + "documentsequenc": "documentsequenc", + "state_name": "state_name", + "Currency": "Currency", + "token_name": "token_name", + "state": "state", + "Adv5": "Adv5", + "Adv4": "Adv4", + "Adv3": "Adv3", + "addition": "addition", + "automulti": "automulti", + "calculated_Field": "calculated_Field", + "counrymulti": "counrymulti", + "Paragraph_Field2": "Paragraph_Field2", + "Number_Field": "Number_Field", + "Basicp1": "Basicp1", + "Sum": "Sum", + "ButtonUpdate": "ButtonUpdate", + "datagrid_Field": "datagrid_Field", + "Email_Field": "Email_Field", + "audio_Field2": "audio_Field2", + "QRCode_Field2": "QRCode_Field2", + "dylist": "dylist", + "Basicp3": "Basicp3", + "Basicp2": "Basicp2", + "stmlit": "stmlit", + "1ega": "1ega", + "Country": "Country", + "BarCode_Field2": "BarCode_Field2", + "Imageupload_Field": "Imageupload_Field", + "dy2": "dy2", + "name2": "name2", + "idfemale": "idfemale", + "dy1": "dy1", + "Url_Field2": "Url_Field2", + "t1": "t1", + "age2": "age2", + "t2": "t2", + "age1": "age1", + "Sum2": "Sum2", + "t4": "t4", + "Decimal_Field2": "Decimal_Field2", + "Description": "Description", + "gender": "gender", + "select_Field": "select_Field", + "QRCode_Field": "QRCode_Field", + "Datetime_Field": "Datetime_Field", + "sum": "sum", + "test1": "test1", + "Test11": "Test11", + "Checkout_Field": "Checkout_Field", + "Ad6": "Ad6", + "picupload": "picupload", + "Textarea_Field": "Textarea_Field", + "Textarea": "Textarea", + "Ad8": "Ad8", + "Ad7": "Ad7", + "Ad9": "Ad9", + "num1": "num1", + "multiplication": "multiplication", + "Date_Field": "Date_Field", + "num3": "num3", + "num2": "num2", + "Token_registery": "Token_registery", + "dymulti": "dymulti", + "Toggle_Switch": "Toggle_Switch", + "last_name": "last_name", + "atoc": "atoc", + "Percentage_Field2": "Percentage_Field2", + "Test22": "Test22", + "Date_Field2": "Date_Field2", + "default_Prce": "default_Prce", + "token": "token", + "test2": "test2", + "test3": "test3", + "dymlti1": "dymlti1", + "Fileupload_Field2": "Fileupload_Field2", + "audio_Field": "audio_Field", + "mobile_number": "mobile_number", + "Decimal_Field": "Decimal_Field", + "country": "country", + "ismale": "ismale", + "Currency2": "Currency2", + "Name": "Name", + "atc2": "atc2", + "data_grid_Field": "data_grid_Field", + "BarCode_Field": "BarCode_Field", + "Imageupload_Field2": "Imageupload_Field2", + "recaptcha2": "recaptcha2", + "Buttonupdate2": "Buttonupdate2", + "test": "test", + "atdy1": "atdy1", + "Phone_Number2": "Phone_Number2", + "atdy2": "atdy2", + "Sttest": "Sttest", + "Percentage_Field": "Percentage_Field", + "Textarea2": "Textarea2", + "Url_Field": "Url_Field", + "Active": "Active", + "dymlt2": "dymlt2", + "Paragraph_Field": "Paragraph_Field", + "State": "State", + "district": "district", + "name": "name", + "UserId_Field": "UserId_Field", + "Email_Field2": "Email_Field2", + "Static": "Static", + "District": "District", + "Ad10": "Ad10", + "about_yourself": "about_yourself", + "datagrid_Field2": "datagrid_Field2", + "Toggle_Switch2": "Toggle_Switch2", + "Dv2": "Dv2", + "Dynamic": "Dynamic", + "description": "description", + "number1": "number1", + "Phone_Number": "Phone_Number", + "Fileupload_Field": "Fileupload_Field", + "number2": "number2", + "Value_List_Field": "Value_List_Field", + "Value_List_Field2": "Value_List_Field2", + "district_name": "district_name", + "OneToOne": "OneToOne", + "recaptcha": "recaptcha", + "stmmlt2": "stmmlt2", + "country_name": "country_name", + "Dependent_Dropdown_Field": "Dependent_Dropdown_Field", + "Adv1": "Adv1", + "OneToManyExtension": "OneToManyExtension", + "Datetime_Field2": "Datetime_Field2", + "country_list": "country_list", + "Textarea_Field2": "Textarea_Field2", + "Defatest": "Defatest", + "Approved_Field": "Approved_Field", + "select_Field2": "select_Field2", + "Password_Field": "Password_Field", + "age": "age", + "Button_Field": "Button_Field" +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/assets/i18n/hi.json b/frontend/angular-clarity-master/src/assets/i18n/hi.json new file mode 100644 index 0000000..8f6d890 --- /dev/null +++ b/frontend/angular-clarity-master/src/assets/i18n/hi.json @@ -0,0 +1,224 @@ +{ + "BREADCRUMB_HOME": "मुखपृष्ठ", + "BREADCRUMB_ABOUT_US": "हमारे बारे में", + "ABOUT_TITLE": "हमारे बारे में", + "SETUP": "सेटअप", + "SETUP_TOOLS": "सेटअप टूल्स", + "USER_MAINTENANCE": "उपयोगकर्ता रखरखाव", + "REPORTS": "रिपोर्ट्स", + "REPORTS_DESCRIPTION": "रिपोर्ट्स विवरण", + "USER_GROUP_MAINTENANCE": "उपयोगकर्ता समूह रखरखाव", + "ABOUT_DESCRIPTION": "यदि आपके पास पहुँच है, तो नए उपयोगकर्ताओं के लिए नया प्रोजेक्ट बनाएं। अगर आपके पास पहुँच नहीं है, तो कृपया व्यवस्थापक से संपर्क करें।", + "HOME": "मुख्य पृष्ठ", + "SECURITY": "सुरक्षा", + "MENU_MAINTENANCE": "मेनू रखरखाव", + "MAIN_MENU": "मुख्य मेनू", + "DOWNLOAD_TEMPLATE": "टेम्प्लेट डाउनलोड करें", + "IMPORT": "आयात करें", + "EXPORT_XLSX": "XLSX के रूप में निर्यात करें", + "ADD": "जोड़ें", + "MENU_ACCESS_CONTROL": "मेनू एक्सेस कंट्रोल", + "EDIT_MODE": "संपादन मोड", + "FOR": "के लिए", + "RELOAD": "रिलोड करें", + "SHOW_ALL": "सभी दिखाएं", + "ONLY_MAIN_MENU": "केवल मुख्य मेनू", + "NO_DATA_AVAILABLE": "कोई डेटा उपलब्ध नहीं है", + "NO": "संख्या", + "MENU_ITEM_NAME": "मेनू आइटम नाम", + "VIEW": "देखें", + "CREATE": "बनाएं", + "EDIT": "संपादित करें", + "DELETE": "हटाएं", + "QUERY": "क्वेरी", + "EXPORT": "निर्यात करें", + "SYNC": "सिंक करें", + "editMode": "संपादन मोड", + "setupCode": "सेटअप कोड", + "value": "मूल्य", + "schedulerTimer": "समय सारणी टाइमर", + "schedulerTimerTooltip": "समय सारणी के लिए समय अंतराल", + "leaseTaxCode": "लीज़ कर कोड", + "taxCodeTooltip": "लीज़ के लिए कर कोड", + "vesselConfProcessLimit": "जहाज कॉन्फ़िगरेशन प्रक्रिया सीमा", + "vesselConfProcessLimitTooltip": "जहाज कॉन्फ़िगरेशन प्रक्रिया के लिए सीमा", + "rowToDisplay": "दिखाने के लिए पंक्तियाँ", + "rowToDisplayTooltip": "यूआई में दिखाने के लिए पंक्तियों की संख्या", + "linkToDisplay": "दिखाने के लिए लिंक", + "linkToDisplayTooltip": "पृष्ठ पर दिखाने के लिए URL", + "rowToAdd": "जोड़ने के लिए पंक्तियाँ", + "rowToAddTooltip": "तालिका में जोड़ने के लिए पंक्तियों की संख्या", + "lovRowToDisplay": "LOV पंक्तियाँ दिखाने के लिए", + "lovRowToDisplayTooltip": "मूल्यों की सूची दिखाने के लिए पंक्तियाँ", + "lovLinkToDisplay": "LOV लिंक दिखाने के लिए", + "lovLinkToDisplayTooltip": "LOV लिंक के लिए URL", + "oidServerName": "OID सर्वर का नाम", + "oidServerNameTooltip": "OID सर्वर का नाम", + "oidBase": "OID बेस", + "oidBaseTooltip": "OID के लिए आधार URL", + "oidAdminUser": "OID एडमिन यूज़र", + "oidAdminUserTooltip": "OID एक्सेस के लिए एडमिन यूज़र", + "oidServerPort": "OID सर्वर पोर्ट", + "oidServerPortTooltip": "OID सर्वर के लिए पोर्ट संख्या", + "userDefaultGroup": "उपयोगकर्ता डिफ़ॉल्ट समूह", + "defaultDepartment": "डिफ़ॉल्ट विभाग", + "defaultPosition": "डिफ़ॉल्ट स्थिति", + "singleCharge": "एकल शुल्क", + "firstDayOftheWeek": "सप्ताह का पहला दिन", + "hourPerShift": "प्रति शिफ्ट घंटा", + "cnBillingFrequency": "सीएन बिलिंग आवृत्ति", + "billingDepartmentCode": "बिलिंग विभाग कोड", + "basePriceList": "बेस मूल्य सूची", + "nonContainerServiceOrder": "गैर-कंटेनर सेवा आदेश", + "ediMaeSchedulerONOFF": "ईडीआई एमएई शेड्यूलर ऑन/ऑफ़", + "ediSchedulerONOFF": "ईडीआई शेड्यूलर ऑन/ऑफ़", + "uploadLogo": "लोगो अपलोड करें", + "companyDisplayName": "कंपनी डिस्प्ले नाम", + "systemParameter": "सिस्टम पैरामीटर", + "accessType": "एक्सेस प्रकार", + "add": "जोड़ें", + "modules": "मॉड्यूल्स", + "loading": "लोड हो रहा है ...", + "name": "नाम", + "default": "डिफ़ॉल्ट", + "description": "विवरण", + "addModules": "मॉड्यूल जोड़ें", + "edit": "संपादित करें", + "delete": "हटाएं", + "usersPerPage": "प्रति पृष्ठ उपयोगकर्ता", + "of": "का", + "users": "उपयोगकर्ता", + "addAccessType": "अक्सेस प्रकार जोड़ें", + "cancel": "रद्द करें", + "areYouSureDelete": "क्या आप निश्चित हैं कि आप हटाना चाहते हैं?", + "updateAccessType": "एक्सेस प्रकार अपडेट करें", + "update": "अद्यतन करें", + "SEQ_GENERATOR": "क्रम जनरेटर", + "CURRENT_NO": "वर्तमान संख्या", + "NAME": "नाम", + "PREFIX": "प्रिफिक्स", + "SEPARATOR": "विभाजक", + "SEQUENCE_SIZE": "सीक्वेंस आकार", + "REPORT": "रिपोर्ट", + "REPORT_RUNNER": "रिपोर्ट रनर", + "REPORT_NAME": "रिपोर्ट नाम", + "REPORT_DESCRIPTION": "रिपोर्ट विवरण", + "API_REGISTERY": "एपीआई रजिस्ट्री", + "API_REGISTERY_DESCRIPTION": "एपीआई रजिस्ट्री विवरण", + "ACTIVE": "सक्रिय", + "FOLDER_NAME": "फ़ोल्डर नाम", + "ACTION": "क्रिया", + "SET_UP": "सेट अप", + "GO_TO": "जाएं", + "USERS_PER_PAGE": "प्रति पृष्ठ उपयोगकर्ता", + "OF": "का", + "USERS": "उपयोगकर्ता", + "ARE_YOU_SURE": "क्या आप वाकई इसे हटाना चाहते हैं?", + "CANCEL": "रद्द करें", + "ALL_REPORTS": "सभी रिपोर्ट्स", + "ALL_REPORT": "सभी रिपोर्ट", + "REPORT_BUILDER_SQL": "रिपोर्ट बिल्डर (SQL)", + "REPORT_BUILDER_URL": "रिपोर्ट बिल्डर (URL)", + "LOADING_MESSAGE": "डैशबोर्ड पाया जा सकता है। लोड हो रहा है..", + "START_FROM_SCRATCH": "शुरू से शुरू करें", + "IMPORT_TEMPLATE": "टेम्पलेट से आयात करें", + "IMPORT_PUBLIC_PROJECT": "सार्वजनिक परियोजना से आयात करें", + "DELETE_CONFIRMATION": "क्या आप वाकई हटाना चाहते हैं?", + "LAST_UPDATED_ON": "अंतिम अपडेट:", + "CREATE_NEW_REPORT": "नई रिपोर्ट बनाएं", + "ADD_MODE": "जोड़ने का मोड", + "NAME": "नाम", + "ENTER_NAME": "नाम दर्ज करें", + "DESCRIPTION": "विवरण", + "ENTER_DESCRIPTION": "विवरण दर्ज करें", + "ACTIVE": "सक्रिय", + "CANCEL": "रद्द करें", + "SUBMIT": "जमा करें", + "home": "होम", + "dashboard": "डैशबोर्ड", + "all_dashboard": "सभी डैशबोर्ड", + "dashboard_builder": "डैशबोर्ड बिल्डर", + "dashboard_found": "डैशबोर्ड मिल गया। लोड हो रहा है..", + "loading": "लोड हो रहा है ...", + "last_updated": "अंतिम अद्यतन", + "start_from_scratch": "शुरुआत से शुरू करें", + "import_template": "टेम्पलेट से आयात करें", + "import_public_project": "सार्वजनिक परियोजना से आयात करें", + "delete_confirmation": "क्या आप वाकई हटाना चाहते हैं?", + "cancel": "रद्द करें", + "delete": "हटाएं", + "Dashboard_builder": "डैशबोर्ड बिल्डर", + "Go_to": "जाएं", + "Dashboard_Name": "डैशबोर्ड का नाम", + "Description": "विवरण", + "Security_Profile": "सुरक्षा प्रोफ़ाइल", + "Add_to_home": "होम पर जोड़ें", + "Action": "क्रिया", + "Delete": "हटाएं", + "Who_Column": "कौन कॉलम", + "Account_ID": "खाता आईडी", + "Created_At": "बनाया गया", + "Created_By": "बनाने वाला", + "Updated_At": "अपडेट किया गया", + "Updated_By": "अपडेट करने वाला", + "Start_from_scratch": "शुरू से शुरू करें", + "Import_from_a_template": "टेम्पलेट से आयात करें", + "Import_from_public_project": "सार्वजनिक प्रोजेक्ट से आयात करें", + "Are_you_sure_to_delete": "क्या आप सच में हटाना चाहते हैं?", + "Dashboard_runner": "डैशबोर्ड रनर", + "define_dashboard": "डैशबोर्ड परिभाषित करें", + "add_mode": "जोड़ने का मोड", + "dashboard_name_label": "डैशबोर्ड का नाम", + "dashboard_name_placeholder": "डैशबोर्ड का नाम दर्ज करें", + "security_profile_label": "सुरक्षा प्रोफाइल", + "security_profile_placeholder": "सुरक्षा प्रोफाइल दर्ज करें", + "description_label": "विवरण", + "description_placeholder": "विवरण दर्ज करें", + "add_to_dashboard_label": "डैशबोर्ड में जोड़ें", + "back_button": "वापस", + "submit_button": "सबमिट", + "ACTIVITIES": "गतिविधियाँ", + "SUGGESTION_FOR_YOU": "आपके लिए सुझाव", + "LOADING": "लोड हो रहा है ...", + "NOTIFICATION_NOT_FOUND": "सूचना मिल सकती है।", + "SUGGESTION_NOT_FOUND": "सुझाव मिल सकता है।", + "SERVICE": "सेवा", + "Last Updated On": "आखरी बार अपडेट किया गया", + "REPORT_BUILDER_2": "रिपोर्ट बिल्डर 2", + "REPORT_RUNNER": "रिपोर्ट रनर", + "ADD": "जोड़ें", + "SET_UP": "सेट अप करें", + "REPORT_NAME": "रिपोर्ट का नाम", + "REPORT_DESCRIPTION": "रिपोर्ट विवरण", + "ACTIVE": "सक्रिय", + "ACTION": "क्रिया", + "DELETE": "हटाएँ", + "WHO_COLUMN": "कौन कॉलम", + "ACCOUNT_ID": "खाता आईडी", + "CREATED_AT": "बनाया गया", + "CREATED_BY": "द्वारा बनाया गया", + "UPDATED_AT": "अपडेट किया गया", + "UPDATED_BY": "द्वारा अपडेट किया गया", + "DELETE_CONFIRMATION": "क्या आप वाकई डिलीट करना चाहते हैं?", + "USERGROUP_NO": "उपयोगकर्ता समूह संख्या", + "GROUP_NAME": "समूह नाम", + "GROUP_DESC": "विवरण", + "GROUP_LEVEL": "समूह स्तर", + "STATUS": "स्थिति", + "UPDATED_DATE": "अद्यतन तिथि", + "RECORDS_PER_PAGE": "प्रति पृष्ठ रिकॉर्ड", + "IMPORT_FILE": "फ़ाइल आयात करें", + "UPDATE": "अद्यतन करें", + "ARE_YOU_SURE_DELETE": "क्या आप वाकई इसे हटाना चाहते हैं?", + "THIS_FIELD_REQUIRED": "*यह फ़ील्ड आवश्यक है", + "NO": "संख्या", + "MENU_ITEM_NAME": "मेनू आइटम नाम", + "ID": "आईडी", + "SEQUENCE": "क्रम", + "MODULE_NAME": "मॉड्यूल नाम", + "MENU_ACTION_LINK": "मेनू क्रिया लिंक", + "STATUS": "स्थिति", + "SUB_MENU": "उप मेनू", + "ACTION": "क्रिया", + "BUILDER ITem": "" +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/assets/images/2021-12-24_1662642503238.png b/frontend/angular-clarity-master/src/assets/images/2021-12-24_1662642503238.png new file mode 100644 index 0000000..3a1c499 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/2021-12-24_1662642503238.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/403.webp b/frontend/angular-clarity-master/src/assets/images/403.webp new file mode 100644 index 0000000..3084cda Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/403.webp differ diff --git a/frontend/angular-clarity-master/src/assets/images/Header.png b/frontend/angular-clarity-master/src/assets/images/Header.png new file mode 100644 index 0000000..7c31ed6 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/Header.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/HeaderLines.png b/frontend/angular-clarity-master/src/assets/images/HeaderLines.png new file mode 100644 index 0000000..aeb32c8 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/HeaderLines.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/MultipleLines.png b/frontend/angular-clarity-master/src/assets/images/MultipleLines.png new file mode 100644 index 0000000..15c6c0f Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/MultipleLines.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/OnlyLines.png b/frontend/angular-clarity-master/src/assets/images/OnlyLines.png new file mode 100644 index 0000000..57cc6c3 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/OnlyLines.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/Web-Page-Background-Color.jpg b/frontend/angular-clarity-master/src/assets/images/Web-Page-Background-Color.jpg new file mode 100644 index 0000000..d9a6044 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/Web-Page-Background-Color.jpg differ diff --git a/frontend/angular-clarity-master/src/assets/images/copyfromPrj.png b/frontend/angular-clarity-master/src/assets/images/copyfromPrj.png new file mode 100644 index 0000000..557df67 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/copyfromPrj.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/copytemplate.png b/frontend/angular-clarity-master/src/assets/images/copytemplate.png new file mode 100644 index 0000000..f771715 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/copytemplate.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/database.png b/frontend/angular-clarity-master/src/assets/images/database.png new file mode 100644 index 0000000..01622c7 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/database.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/fromscratch.png b/frontend/angular-clarity-master/src/assets/images/fromscratch.png new file mode 100644 index 0000000..e51ca35 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/fromscratch.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/git.png b/frontend/angular-clarity-master/src/assets/images/git.png new file mode 100644 index 0000000..89268b1 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/git.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/icon/cradiant.png b/frontend/angular-clarity-master/src/assets/images/icon/cradiant.png new file mode 100644 index 0000000..620640a Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/icon/cradiant.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/icon/logo.ico b/frontend/angular-clarity-master/src/assets/images/icon/logo.ico new file mode 100644 index 0000000..8081c7c Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/icon/logo.ico differ diff --git a/frontend/angular-clarity-master/src/assets/images/icon/micrologo.png b/frontend/angular-clarity-master/src/assets/images/icon/micrologo.png new file mode 100644 index 0000000..7334d56 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/icon/micrologo.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/icon/sitelogo.png b/frontend/angular-clarity-master/src/assets/images/icon/sitelogo.png new file mode 100644 index 0000000..41e834f Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/icon/sitelogo.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/images.png b/frontend/angular-clarity-master/src/assets/images/images.png new file mode 100644 index 0000000..e8798a3 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/images.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/logo.svg b/frontend/angular-clarity-master/src/assets/images/logo.svg new file mode 100644 index 0000000..4abf5f5 --- /dev/null +++ b/frontend/angular-clarity-master/src/assets/images/logo.svg @@ -0,0 +1,28 @@ + + + my vector image + + + + + Layer 1 + + + +

+ Sprin +

+
+ +

+ Gular +

+
+
+ + +
diff --git a/frontend/angular-clarity-master/src/assets/images/micro logo.png b/frontend/angular-clarity-master/src/assets/images/micro logo.png new file mode 100644 index 0000000..7334d56 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/micro logo.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/new.png b/frontend/angular-clarity-master/src/assets/images/new.png new file mode 100644 index 0000000..b114da1 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/new.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/profile-icon.png b/frontend/angular-clarity-master/src/assets/images/profile-icon.png new file mode 100644 index 0000000..bf82252 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/profile-icon.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/profile1.jpg b/frontend/angular-clarity-master/src/assets/images/profile1.jpg new file mode 100644 index 0000000..1858e45 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/profile1.jpg differ diff --git a/frontend/angular-clarity-master/src/assets/images/profile3.jpg b/frontend/angular-clarity-master/src/assets/images/profile3.jpg new file mode 100644 index 0000000..855bfd1 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/profile3.jpg differ diff --git a/frontend/angular-clarity-master/src/assets/images/qr-code.png b/frontend/angular-clarity-master/src/assets/images/qr-code.png new file mode 100644 index 0000000..9199216 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/qr-code.png differ diff --git a/frontend/angular-clarity-master/src/assets/images/view.jpg b/frontend/angular-clarity-master/src/assets/images/view.jpg new file mode 100644 index 0000000..40bd299 Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/view.jpg differ diff --git a/frontend/angular-clarity-master/src/assets/images/who.png b/frontend/angular-clarity-master/src/assets/images/who.png new file mode 100644 index 0000000..4311a3f Binary files /dev/null and b/frontend/angular-clarity-master/src/assets/images/who.png differ diff --git a/frontend/angular-clarity-master/src/environments/environment.prod.ts b/frontend/angular-clarity-master/src/environments/environment.prod.ts new file mode 100644 index 0000000..f038c84 --- /dev/null +++ b/frontend/angular-clarity-master/src/environments/environment.prod.ts @@ -0,0 +1,17 @@ +export const environment = { + production: true, + appName: 'My Application', + version: '11.2.13', + subVersion: '2021.05.13-01', + apiUrl: 'http://localhost:3000', + whiteUrl: 'http://localhost:3000', + blackUrl: 'http://localhost:3000/login', + + // changeble url // port + captchaSiteKey: '6LfrdSUpAAAAALkYDmnvdX3GLLCArgPWNHfXasjP', + + //Deployment configs + + + +}; diff --git a/frontend/angular-clarity-master/src/environments/environment.ts b/frontend/angular-clarity-master/src/environments/environment.ts new file mode 100644 index 0000000..d3c76ee --- /dev/null +++ b/frontend/angular-clarity-master/src/environments/environment.ts @@ -0,0 +1,17 @@ +export const environment = { + production: false, + appName: 'My Application', + version: '11.2.13', + subVersion: '2021.05.13-01', + apiUrl: 'http://localhost:3000', + whiteUrl: 'http://localhost:3000', + blackUrl: 'http://localhost:3000/login', + + // changeblelocal configs url + captchaSiteKey: '6LfrdSUpAAAAALkYDmnvdX3GLLCArgPWNHfXasjP', + + //Deployment configs + backendUrl:'http://localhost:9292', + // backendUrl:'http://157.66.191.31:34530/back', + +}; diff --git a/frontend/angular-clarity-master/src/favicon.ico b/frontend/angular-clarity-master/src/favicon.ico new file mode 100644 index 0000000..997406a Binary files /dev/null and b/frontend/angular-clarity-master/src/favicon.ico differ diff --git a/frontend/angular-clarity-master/src/index.html b/frontend/angular-clarity-master/src/index.html new file mode 100644 index 0000000..08d3e58 --- /dev/null +++ b/frontend/angular-clarity-master/src/index.html @@ -0,0 +1,24 @@ + + + + + + cloudnSure + + + + + + + + + + + + + Application Loading... + + + + + diff --git a/frontend/angular-clarity-master/src/main.ts b/frontend/angular-clarity-master/src/main.ts new file mode 100644 index 0000000..c7b673c --- /dev/null +++ b/frontend/angular-clarity-master/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/frontend/angular-clarity-master/src/polyfills.ts b/frontend/angular-clarity-master/src/polyfills.ts new file mode 100644 index 0000000..dcd18ea --- /dev/null +++ b/frontend/angular-clarity-master/src/polyfills.ts @@ -0,0 +1,53 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + * because those flags need to be set before `zone.js` being loaded, and webpack + * will put import in the top of bundle, so user need to create a separate file + * in this directory (for example: zone-flags.ts), and put the following flags + * into that file, and then add the following code before importing zone.js. + * import './zone-flags'; + * + * The flags allowed in zone-flags.ts are listed here. + * + * The following flags will work for all browsers. + * + * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + * + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + * + * (window as any).__Zone_enable_cross_context_check = true; + * + */ + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/frontend/angular-clarity-master/src/server/app.js b/frontend/angular-clarity-master/src/server/app.js new file mode 100644 index 0000000..a98674f --- /dev/null +++ b/frontend/angular-clarity-master/src/server/app.js @@ -0,0 +1,30 @@ + +const express = require('express'); +const { createProxyMiddleware } = require('http-proxy-middleware'); +const cors = require('cors') +const app = express(); +const proxy = require('express-http-proxy'); + +app.use(cors({ + origin: '*' +})) + +//Deployment configs +app.use('/repos', createProxyMiddleware({ target: 'https://try.gitea.io/api/v1', changeOrigin: true })); +app.use('/sureconnect', createProxyMiddleware({ target: 'http://43.205.154.152:30174', changeOrigin: true })); +app.use('/sureops', createProxyMiddleware({ target: 'http://43.205.154.152:31123', changeOrigin: true })); +app.use('/entityBuilder', createProxyMiddleware({ target: 'http://43.205.154.152:30171', changeOrigin: true })); +app.use('/surechat', createProxyMiddleware({ target: 'http://43.205.154.152:30172', changeOrigin: true })); +app.use('/jobpro', createProxyMiddleware({ target: 'http://43.205.154.152:30167', changeOrigin: true })); +app.use('/Surecommunication', createProxyMiddleware({ target: 'http://43.205.154.152:30187', changeOrigin: true })); +app.use('/surejob', createProxyMiddleware({ target: 'http://43.205.154.152:30188', changeOrigin: true })); +// app.use('/jobpro', createProxyMiddleware({ target: 'http://localhost:8087', changeOrigin: true })); +// app.use('/Surecommunication', createProxyMiddleware({ target: 'http://localhost:19002', changeOrigin: true })); +// app.use('/sureops', createProxyMiddleware({ target: 'http://localhost:9090', changeOrigin: true })); +// app.use('/', createProxyMiddleware({ target: 'http://localhost:8080', changeOrigin: true })); +// app.use('/', createProxyMiddleware({ target: 'http://localhost:9190', changeOrigin: true })); +// app.listen(3000); +// console.log('Node server running on port 3000'); +app.listen(3000, () => { + console.log("Server started in port 3000!"); +}); \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/server/db.json b/frontend/angular-clarity-master/src/server/db.json new file mode 100644 index 0000000..16b3149 --- /dev/null +++ b/frontend/angular-clarity-master/src/server/db.json @@ -0,0 +1,8 @@ +{ + "add": [ + { + "title": "todo", + "id": "Gosd82Z" + } + ] +} diff --git a/frontend/angular-clarity-master/src/server/package-lock.json b/frontend/angular-clarity-master/src/server/package-lock.json new file mode 100644 index 0000000..0d6968c --- /dev/null +++ b/frontend/angular-clarity-master/src/server/package-lock.json @@ -0,0 +1,537 @@ +{ + "name": "server", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/http-proxy": { + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz", + "integrity": "sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.33.tgz", + "integrity": "sha512-miWq2m2FiQZmaHfdZNcbpp9PuXg34W5JZ5CrJ/BaS70VuhoJENBEQybeiYSaPBRNq6KQGnjfEnc/F3PN++D+XQ==" + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "requires": { + "follow-redirects": "^1.10.0" + } + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "express-http-proxy": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/express-http-proxy/-/express-http-proxy-1.6.3.tgz", + "integrity": "sha512-/l77JHcOUrDUX8V67E287VEUQT0lbm71gdGVoodnlWBziarYKgMcpqT7xvh/HM8Jv52phw8Bd8tY+a7QjOr7Yg==", + "requires": { + "debug": "^3.0.1", + "es6-promise": "^4.1.1", + "raw-body": "^2.3.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + } + }, + "follow-redirects": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.2.tgz", + "integrity": "sha512-yLR6WaE2lbF0x4K2qE2p9PEXKLDjUjnR/xmjS3wHAYxtlsI9MLLBJUZirAHKzUZDGLxje7w/cXR49WOUo4rbsA==" + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-middleware": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.5.tgz", + "integrity": "sha512-CKzML7u4RdGob8wuKI//H8Ein6wNTEQR7yjVEzPbhBLGdOfkfvgTnp2HLnniKBDP9QW4eG10/724iTWLBeER3g==", + "requires": { + "@types/http-proxy": "^1.17.4", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.19", + "micromatch": "^4.0.2" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==" + }, + "mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "requires": { + "mime-db": "1.49.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + } + } +} diff --git a/frontend/angular-clarity-master/src/server/package.json b/frontend/angular-clarity-master/src/server/package.json new file mode 100644 index 0000000..5ea1e92 --- /dev/null +++ b/frontend/angular-clarity-master/src/server/package.json @@ -0,0 +1,18 @@ +{ + "name": "server", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "axios": "^0.21.1", + "cors": "^2.8.5", + "express": "^4.17.1", + "express-http-proxy": "^1.6.3", + "http-proxy-middleware": "^1.0.5" + } +} diff --git a/frontend/angular-clarity-master/src/styles.scss b/frontend/angular-clarity-master/src/styles.scss new file mode 100644 index 0000000..9152056 --- /dev/null +++ b/frontend/angular-clarity-master/src/styles.scss @@ -0,0 +1,285 @@ +@import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css); +@import '~@clr/icons/clr-icons.min.css'; + +// Modern Design System Imports +@import './styles/design-tokens'; +@import './styles/theme-variables'; +@import './styles/base'; +@import './styles/components'; +@import './styles/animations'; + +// Google Fonts - Modern Typography +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100;200;300;400;500;600;700;800&display=swap'); + +/* Legacy font set ==================== */ +@import url(https://fonts.googleapis.com/css?family=Athiti|Bai+Jamjuree|Chakra+Petch|Charmonman|Chonburi|Fahkwang|Itim|K2D|Kanit|KoHo|Kodchasan|Krub|Maitree|Mali|Mitr|Niramit|Pattaya|Pridi|Prompt|Sriracha|Srisakdi|Taviraj|Trirong); + +.font-athiti { font-family: 'Athiti', sans-serif; } +.font-bai-jamjuree { font-family: 'Bai Jamjuree', sans-serif; } +.font-chakra-petch { font-family: 'Chakra Petch', sans-serif; } +.font-charmonman { font-family: 'Charmonman', cursive; } +.font-chonburi { font-family: 'Chonburi', cursive; } +.font-fahkwang { font-family: 'Fahkwang', sans-serif; } +.font-itim { font-family: 'Itim', cursive; } +.font-k2d { font-family: 'K2D', sans-serif; } +.font-kodchasan { font-family: 'Kodchasan', sans-serif; } +.font-kanit { font-family: 'Kanit', sans-serif; } +.font-koHo { font-family: 'KoHo', sans-serif; } +.font-krub { font-family: 'Krub', sans-serif; } +.font-mali { font-family: 'Mali', cursive; } +.font-mitr { font-family: 'Mitr', sans-serif; } +.font-maitree { font-family: 'Maitree', serif; } +.font-niramit { font-family: 'Niramit', sans-serif; } +.font-pattaya { font-family: 'Pattaya', sans-serif; } +.font-pridi { font-family: 'Pridi', serif; } +.font-prompt { font-family: 'Prompt', sans-serif; } +.font-srisakdi { font-family: 'Srisakdi', cursive; } +.font-taviraj { font-family: 'Taviraj', serif; } +.font-sriracha { font-family: 'Sriracha', cursive; } +.font-trirong { font-family: 'Trirong', serif; } + +@font-face { + font-family: 'th-sarabun'; + src: url('./assets/fonts/THSarabun.ttf') format('truetype'), + url('/assets/fonts/THSarabun Bold.ttf') format('truetype'), + url('/assets/fonts/THSarabun Italic.ttf') format('truetype'), + url('/assets/fonts/THSarabun Bold Italic.ttf') format('truetype'); + } +.font-thsarabun { font-family: 'th-sarabun', cursive; font-size : 16pt; } + +.font-bold { font-weight: bold; } +.font-italic { font-style: italic; } +/* end font set ==================== */ + +.breadcrumb { + font-family: 'Trirong', serif; + margin-top: 0px; +} + +.breadcrumb-arrow { + height: 36px; + padding: 0; + line-height: 36px; + list-style: none; + background-color: #ebeceb +} +.breadcrumb-arrow li:first-child a { + border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px +} +.breadcrumb-arrow li, .breadcrumb-arrow li a, .breadcrumb-arrow li span { + display: inline-block; + vertical-align: top +} +.breadcrumb-arrow li:not(:first-child) { + margin-left: -5px +} +.breadcrumb-arrow li+li:before { + padding: 0; + content: "" +} +.breadcrumb-arrow li span { + padding: 0 10px +} +.breadcrumb-arrow li a, .breadcrumb-arrow li:not(:first-child) span { + height: 36px; + padding: 0 10px 0 25px; + line-height: 36px +} +.breadcrumb-arrow li:first-child a { + padding: 0 10px +} +.breadcrumb-arrow li a { + position: relative; + color: #fff; + text-decoration: none; + background-color: rgb(128, 130, 131); + border: 1px solid rgb(128, 130, 131); +} +.breadcrumb-arrow li:first-child a { + padding-left: 10px +} +.breadcrumb-arrow li a:after, .breadcrumb-arrow li a:before { + position: absolute; + top: -1px; + width: 0; + height: 0; + content: ''; + border-top: 18px solid transparent; + border-bottom: 18px solid transparent +} +.breadcrumb-arrow li a:before { + right: -10px; + z-index: 3; + border-left-color: rgb(128, 130, 131); + border-left-style: solid; + border-left-width: 11px +} +.breadcrumb-arrow li a:after { + right: -11px; + z-index: 2; + border-left: 11px solid #38393a +} +.breadcrumb-arrow li a:focus, .breadcrumb-arrow li a:hover { + background-color: #b7bbb7; + border: 1px solid #b7bbb7; + text-shadow: 1px 1px 1px rgb(20, 20, 20); +} +.breadcrumb-arrow li a:focus:before, .breadcrumb-arrow li a:hover:before { + border-left-color: #b7bbb7 +} +.breadcrumb-arrow li a:active { + background-color: #c5ccc5; + border: 1px solid #c5ccc5; +} +.breadcrumb-arrow li a:active:after, .breadcrumb-arrow li a:active:before { + border-left-color: #adb6ad; +} +.breadcrumb-arrow li span { + color: #7e8a83; +} + +.full-div { +padding: 0px 0px 0px 0px; +height: 100vh; +width: 100%; +margin-right: 0; +} + +.dg-wrapper { + margin-top: 0; + display: flex; + flex-direction: column; + height: 500px; +} + +.dg-wrapper-300 { + margin-top: 0; + display: flex; + flex-direction: column; + height: 300px; +} + +.dg-wrapper-400 { + margin-top: 0; + display: flex; + flex-direction: column; + height: 400px; +} + +.dg-wrapper-450 { + margin-top: 0; + display: flex; + flex-direction: column; + height: 450px; +} + +.dg-wrapper-500 { + display: flex; + flex-direction: column; + height: 500px; +} + +.dg-wrapper-600 { + display: flex; + flex-direction: column; + height: 600px; +} + +.dg-wrapper-700 { + display: flex; + flex-direction: column; + height: 700px; +} + +.dg-wrapper-800 { + display: flex; + flex-direction: column; + height: 800px; +} + +.float-left { + float: left !important; +} + +.float-right { + float: right !important; +} + +// Global styles for enhanced components +.btn { + @extend .modern-btn; +} + +.modal-dialog { + @extend .modern-modal; + + .modal-header { + background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%); + color: $white; + border-radius: $radius-2xl $radius-2xl 0 0; + + .modal-title { + color: $white; + font-weight: $font-bold; + } + + .close { + color: $white; + opacity: 0.8; + + &:hover { + opacity: 1; + } + } + } + + .modal-body { + padding: $space-6; + } + + .modal-footer { + padding: $space-5 $space-6; + background: $gray-50; + border-radius: 0 0 $radius-2xl $radius-2xl; + } +} + +.datagrid { + @extend .modern-table; +} + +.badge { + @extend .modern-badge; +} + +.alert { + @extend .modern-alert; +} + +.spinner { + @extend .modern-spinner; +} + +.skeleton { + @extend .modern-skeleton; +} + +.form-group { + @extend .modern-form-group; + + .form-label { + @extend .form-label; + } + + .form-input, .form-select { + @extend .form-input; + } + + .form-error { + @extend .form-error; + } +} \ No newline at end of file diff --git a/frontend/angular-clarity-master/src/styles/_animations.scss b/frontend/angular-clarity-master/src/styles/_animations.scss new file mode 100644 index 0000000..2471c2e --- /dev/null +++ b/frontend/angular-clarity-master/src/styles/_animations.scss @@ -0,0 +1,602 @@ +// ======================================== +// ANIMATIONS - Smooth & Modern Transitions +// ======================================== + +@import './design-tokens'; + +// Fade Animations +// ======================================== + +@keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes fadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes fadeInDown { + from { + opacity: 0; + transform: translateY(-20px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes fadeInLeft { + from { + opacity: 0; + transform: translateX(-20px); + } + to { + opacity: 1; + transform: translateX(0); + } +} + +@keyframes fadeInRight { + from { + opacity: 0; + transform: translateX(20px); + } + to { + opacity: 1; + transform: translateX(0); + } +} + +// Scale Animations +// ======================================== + +@keyframes scaleIn { + from { + opacity: 0; + transform: scale(0.9); + } + to { + opacity: 1; + transform: scale(1); + } +} + +@keyframes scaleOut { + from { + opacity: 1; + transform: scale(1); + } + to { + opacity: 0; + transform: scale(0.9); + } +} + +@keyframes scaleUp { + from { + transform: scale(1); + } + to { + transform: scale(1.05); + } +} + +@keyframes scaleDown { + from { + transform: scale(1.05); + } + to { + transform: scale(1); + } +} + +// Slide Animations +// ======================================== + +@keyframes slideInUp { + from { + transform: translateY(100%); + } + to { + transform: translateY(0); + } +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + to { + transform: translateY(0); + } +} + +@keyframes slideInLeft { + from { + transform: translateX(-100%); + } + to { + transform: translateX(0); + } +} + +@keyframes slideInRight { + from { + transform: translateX(100%); + } + to { + transform: translateX(0); + } +} + +@keyframes slideOutUp { + from { + transform: translateY(0); + } + to { + transform: translateY(-100%); + } +} + +@keyframes slideOutDown { + from { + transform: translateY(0); + } + to { + transform: translateY(100%); + } +} + +@keyframes slideOutLeft { + from { + transform: translateX(0); + } + to { + transform: translateX(-100%); + } +} + +@keyframes slideOutRight { + from { + transform: translateX(0); + } + to { + transform: translateX(100%); + } +} + +// Rotation Animations +// ======================================== + +@keyframes spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +@keyframes spinReverse { + from { + transform: rotate(360deg); + } + to { + transform: rotate(0deg); + } +} + +@keyframes bounce { + 0%, 20%, 53%, 80%, 100% { + transform: translate3d(0, 0, 0); + } + 40%, 43% { + transform: translate3d(0, -8px, 0); + } + 70% { + transform: translate3d(0, -4px, 0); + } + 90% { + transform: translate3d(0, -2px, 0); + } +} + +@keyframes pulse { + 0% { + transform: scale(1); + } + 50% { + transform: scale(1.05); + } + 100% { + transform: scale(1); + } +} + +@keyframes shake { + 0%, 100% { + transform: translateX(0); + } + 10%, 30%, 50%, 70%, 90% { + transform: translateX(-2px); + } + 20%, 40%, 60%, 80% { + transform: translateX(2px); + } +} + +@keyframes wiggle { + 0%, 7% { + transform: rotateZ(0); + } + 15% { + transform: rotateZ(-15deg); + } + 20% { + transform: rotateZ(10deg); + } + 25% { + transform: rotateZ(-10deg); + } + 30% { + transform: rotateZ(6deg); + } + 35% { + transform: rotateZ(-4deg); + } + 40%, 100% { + transform: rotateZ(0); + } +} + +// Loading Animations +// ======================================== + +@keyframes shimmer { + 0% { + background-position: -200% 0; + } + 100% { + background-position: 200% 0; + } +} + +@keyframes shimmer2 { + 0% { + background-position: 200% 0; + } + 100% { + background-position: -200% 0; + } +} + +@keyframes dots { + 0%, 20% { + color: transparent; + text-shadow: 0.25em 0 0 transparent, 0.5em 0 0 transparent; + } + 40% { + color: currentColor; + text-shadow: 0.25em 0 0 transparent, 0.5em 0 0 transparent; + } + 60% { + text-shadow: 0.25em 0 0 currentColor, 0.5em 0 0 transparent; + } + 80%, 100% { + text-shadow: 0.25em 0 0 currentColor, 0.5em 0 0 currentColor; + } +} + +@keyframes wave { + 0%, 60%, 100% { + transform: initial; + } + 30% { + transform: translateY(-15px); + } +} + +// Hover Animations +// ======================================== + +@keyframes float { + 0% { + transform: translateY(0px); + } + 50% { + transform: translateY(-10px); + } + 100% { + transform: translateY(0px); + } +} + +@keyframes glow { + 0% { + box-shadow: 0 0 5px rgba($primary-500, 0.5); + } + 50% { + box-shadow: 0 0 20px rgba($primary-500, 0.8), 0 0 30px rgba($primary-500, 0.6); + } + 100% { + box-shadow: 0 0 5px rgba($primary-500, 0.5); + } +} + +@keyframes ripple { + 0% { + transform: scale(0); + opacity: 1; + } + 100% { + transform: scale(4); + opacity: 0; + } +} + +// Animation Classes +// ======================================== + +// Fade Classes +.animate-fade-in { + animation: fadeIn $duration-300 $ease-out; +} + +.animate-fade-out { + animation: fadeOut $duration-300 $ease-out; +} + +.animate-fade-in-up { + animation: fadeInUp $duration-500 $ease-out; +} + +.animate-fade-in-down { + animation: fadeInDown $duration-500 $ease-out; +} + +.animate-fade-in-left { + animation: fadeInLeft $duration-500 $ease-out; +} + +.animate-fade-in-right { + animation: fadeInRight $duration-500 $ease-out; +} + +// Scale Classes +.animate-scale-in { + animation: scaleIn $duration-300 $ease-out; +} + +.animate-scale-out { + animation: scaleOut $duration-300 $ease-out; +} + +.animate-scale-up { + animation: scaleUp $duration-200 $ease-out; +} + +.animate-scale-down { + animation: scaleDown $duration-200 $ease-out; +} + +// Slide Classes +.animate-slide-in-up { + animation: slideInUp $duration-500 $ease-out; +} + +.animate-slide-in-down { + animation: slideInDown $duration-500 $ease-out; +} + +.animate-slide-in-left { + animation: slideInLeft $duration-500 $ease-out; +} + +.animate-slide-in-right { + animation: slideInRight $duration-500 $ease-out; +} + +.animate-slide-out-up { + animation: slideOutUp $duration-300 $ease-out; +} + +.animate-slide-out-down { + animation: slideOutDown $duration-300 $ease-out; +} + +.animate-slide-out-left { + animation: slideOutLeft $duration-300 $ease-out; +} + +.animate-slide-out-right { + animation: slideOutRight $duration-300 $ease-out; +} + +// Rotation Classes +.animate-spin { + animation: spin 1s linear infinite; +} + +.animate-spin-reverse { + animation: spinReverse 1s linear infinite; +} + +.animate-bounce { + animation: bounce 1s infinite; +} + +.animate-pulse { + animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; +} + +.animate-shake { + animation: shake 0.5s ease-in-out; +} + +.animate-wiggle { + animation: wiggle 1s ease-in-out; +} + +// Loading Classes +.animate-shimmer { + animation: shimmer 1.5s infinite; +} + +.animate-shimmer2 { + animation: shimmer2 1.5s infinite; +} + +.animate-dots { + animation: dots 1.4s infinite; +} + +.animate-wave { + animation: wave 1.4s infinite; +} + +// Hover Classes +.animate-float { + animation: float 3s ease-in-out infinite; +} + +.animate-glow { + animation: glow 2s ease-in-out infinite; +} + +.animate-ripple { + animation: ripple 0.6s linear; +} + +// Transition Classes +// ======================================== + +.transition-all { + transition: all $duration-300 $ease-out; +} + +.transition-colors { + transition: color $duration-200 $ease-out, background-color $duration-200 $ease-out, border-color $duration-200 $ease-out; +} + +.transition-opacity { + transition: opacity $duration-200 $ease-out; +} + +.transition-transform { + transition: transform $duration-200 $ease-out; +} + +.transition-shadow { + transition: box-shadow $duration-200 $ease-out; +} + +// Hover Effects +// ======================================== + +.hover-lift { + transition: transform $duration-200 $ease-out, box-shadow $duration-200 $ease-out; + + &:hover { + transform: translateY(-2px); + box-shadow: $shadow-lg; + } +} + +.hover-glow { + transition: box-shadow $duration-200 $ease-out; + + &:hover { + box-shadow: 0 0 20px rgba($primary-500, 0.3); + } +} + +.hover-scale { + transition: transform $duration-200 $ease-out; + + &:hover { + transform: scale(1.05); + } +} + +.hover-rotate { + transition: transform $duration-200 $ease-out; + + &:hover { + transform: rotate(5deg); + } +} + +.hover-bounce { + transition: transform $duration-200 $ease-bounce; + + &:hover { + transform: translateY(-4px); + } +} + +// Staggered Animations +// ======================================== + +.stagger-1 { animation-delay: 0.1s; } +.stagger-2 { animation-delay: 0.2s; } +.stagger-3 { animation-delay: 0.3s; } +.stagger-4 { animation-delay: 0.4s; } +.stagger-5 { animation-delay: 0.5s; } +.stagger-6 { animation-delay: 0.6s; } +.stagger-7 { animation-delay: 0.7s; } +.stagger-8 { animation-delay: 0.8s; } + +// Animation States +// ======================================== + +.animation-paused { + animation-play-state: paused; +} + +.animation-running { + animation-play-state: running; +} + +// Reduced Motion Support +// ======================================== + +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + scroll-behavior: auto !important; + } + + .animate-spin, + .animate-pulse, + .animate-bounce, + .animate-float, + .animate-glow { + animation: none; + } +} diff --git a/frontend/angular-clarity-master/src/styles/_base.scss b/frontend/angular-clarity-master/src/styles/_base.scss new file mode 100644 index 0000000..2748726 --- /dev/null +++ b/frontend/angular-clarity-master/src/styles/_base.scss @@ -0,0 +1,411 @@ +// ======================================== +// BASE STYLES - Modern UI Foundation +// ======================================== + +@import './design-tokens'; + + +// CSS Reset & Base Styles +// ======================================== + +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html { + font-size: 16px; + line-height: 1.5; + -webkit-text-size-adjust: 100%; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-rendering: optimizeLegibility; +} + +body { + font-family: $font-primary; + font-size: $text-base; + font-weight: $font-normal; + line-height: $leading-normal; + color: $gray-900; + background: linear-gradient(135deg, $gray-50 0%, $gray-100 100%); + min-height: 100vh; + overflow-x: hidden; +} + +// Typography +// ======================================== + +h1, h2, h3, h4, h5, h6 { + font-family: $font-secondary; + font-weight: $font-semibold; + line-height: $leading-tight; + color: $gray-900; + margin: 0; +} + +h1 { font-size: $text-4xl; } +h2 { font-size: $text-3xl; } +h3 { font-size: $text-2xl; } +h4 { font-size: $text-xl; } +h5 { font-size: $text-lg; } +h6 { font-size: $text-base; } + +p { + margin: 0 0 $space-4 0; + color: $gray-700; +} + +a { + color: $primary-600; + text-decoration: none; + transition: color $duration-200 $ease-out; + + &:hover { + color: $primary-700; + } + + &:focus { + outline: 2px solid $primary-500; + outline-offset: 2px; + border-radius: $radius-sm; + } +} + +// Lists +ul, ol { + margin: 0; + padding: 0; + list-style: none; +} + +// Images +img { + max-width: 100%; + height: auto; + display: block; +} + +// Form Elements +// ======================================== + +input, textarea, select { + font-family: inherit; + font-size: inherit; + line-height: inherit; + margin: 0; +} + +button { + font-family: inherit; + font-size: inherit; + line-height: inherit; + margin: 0; + cursor: pointer; + border: none; + background: none; +} + +// Focus Styles +// ======================================== + +:focus { + outline: 2px solid $primary-500; + outline-offset: 2px; +} + +:focus:not(:focus-visible) { + outline: none; +} + +:focus-visible { + outline: 2px solid $primary-500; + outline-offset: 2px; +} + +// Selection Styles +// ======================================== + +::selection { + background-color: $primary-100; + color: $primary-900; +} + +::-moz-selection { + background-color: $primary-100; + color: $primary-900; +} + +// Scrollbar Styles +// ======================================== + +::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +::-webkit-scrollbar-track { + background: $gray-100; + border-radius: $radius-full; +} + +::-webkit-scrollbar-thumb { + background: $gray-300; + border-radius: $radius-full; + transition: background-color $duration-200 $ease-out; +} + +::-webkit-scrollbar-thumb:hover { + background: $gray-400; +} + +::-webkit-scrollbar-corner { + background: $gray-100; +} + +// Utility Classes +// ======================================== + +// Display +.d-block { display: block; } +.d-inline { display: inline; } +.d-inline-block { display: inline-block; } +.d-flex { display: flex; } +.d-inline-flex { display: inline-flex; } +.d-grid { display: grid; } +.d-none { display: none; } + +// Flexbox +.flex-row { flex-direction: row; } +.flex-col { flex-direction: column; } +.flex-wrap { flex-wrap: wrap; } +.flex-nowrap { flex-wrap: nowrap; } + +.justify-start { justify-content: flex-start; } +.justify-center { justify-content: center; } +.justify-end { justify-content: flex-end; } +.justify-between { justify-content: space-between; } +.justify-around { justify-content: space-around; } + +.items-start { align-items: flex-start; } +.items-center { align-items: center; } +.items-end { align-items: flex-end; } +.items-stretch { align-items: stretch; } + +.flex-1 { flex: 1 1 0%; } +.flex-auto { flex: 1 1 auto; } +.flex-initial { flex: 0 1 auto; } +.flex-none { flex: none; } + +// Spacing +.m-0 { margin: 0; } +.m-1 { margin: $space-1; } +.m-2 { margin: $space-2; } +.m-3 { margin: $space-3; } +.m-4 { margin: $space-4; } +.m-5 { margin: $space-5; } +.m-6 { margin: $space-6; } +.m-8 { margin: $space-8; } + +.mt-0 { margin-top: 0; } +.mt-1 { margin-top: $space-1; } +.mt-2 { margin-top: $space-2; } +.mt-3 { margin-top: $space-3; } +.mt-4 { margin-top: $space-4; } +.mt-5 { margin-top: $space-5; } +.mt-6 { margin-top: $space-6; } +.mt-8 { margin-top: $space-8; } + +.mb-0 { margin-bottom: 0; } +.mb-1 { margin-bottom: $space-1; } +.mb-2 { margin-bottom: $space-2; } +.mb-3 { margin-bottom: $space-3; } +.mb-4 { margin-bottom: $space-4; } +.mb-5 { margin-bottom: $space-5; } +.mb-6 { margin-bottom: $space-6; } +.mb-8 { margin-bottom: $space-8; } + +.ml-0 { margin-left: 0; } +.ml-1 { margin-left: $space-1; } +.ml-2 { margin-left: $space-2; } +.ml-3 { margin-left: $space-3; } +.ml-4 { margin-left: $space-4; } +.ml-5 { margin-left: $space-5; } +.ml-6 { margin-left: $space-6; } +.ml-8 { margin-left: $space-8; } + +.mr-0 { margin-right: 0; } +.mr-1 { margin-right: $space-1; } +.mr-2 { margin-right: $space-2; } +.mr-3 { margin-right: $space-3; } +.mr-4 { margin-right: $space-4; } +.mr-5 { margin-right: $space-5; } +.mr-6 { margin-right: $space-6; } +.mr-8 { margin-right: $space-8; } + +.p-0 { padding: 0; } +.p-1 { padding: $space-1; } +.p-2 { padding: $space-2; } +.p-3 { padding: $space-3; } +.p-4 { padding: $space-4; } +.p-5 { padding: $space-5; } +.p-6 { padding: $space-6; } +.p-8 { padding: $space-8; } + +.pt-0 { padding-top: 0; } +.pt-1 { padding-top: $space-1; } +.pt-2 { padding-top: $space-2; } +.pt-3 { padding-top: $space-3; } +.pt-4 { padding-top: $space-4; } +.pt-5 { padding-top: $space-5; } +.pt-6 { padding-top: $space-6; } +.pt-8 { padding-top: $space-8; } + +.pb-0 { padding-bottom: 0; } +.pb-1 { padding-bottom: $space-1; } +.pb-2 { padding-bottom: $space-2; } +.pb-3 { padding-bottom: $space-3; } +.pb-4 { padding-bottom: $space-4; } +.pb-5 { padding-bottom: $space-5; } +.pb-6 { padding-bottom: $space-6; } +.pb-8 { padding-bottom: $space-8; } + +.pl-0 { padding-left: 0; } +.pl-1 { padding-left: $space-1; } +.pl-2 { padding-left: $space-2; } +.pl-3 { padding-left: $space-3; } +.pl-4 { padding-left: $space-4; } +.pl-5 { padding-left: $space-5; } +.pl-6 { padding-left: $space-6; } +.pl-8 { padding-left: $space-8; } + +.pr-0 { padding-right: 0; } +.pr-1 { padding-right: $space-1; } +.pr-2 { padding-right: $space-2; } +.pr-3 { padding-right: $space-3; } +.pr-4 { padding-right: $space-4; } +.pr-5 { padding-right: $space-5; } +.pr-6 { padding-right: $space-6; } +.pr-8 { padding-right: $space-8; } + +// Text +.text-xs { font-size: $text-xs; } +.text-sm { font-size: $text-sm; } +.text-base { font-size: $text-base; } +.text-lg { font-size: $text-lg; } +.text-xl { font-size: $text-xl; } +.text-2xl { font-size: $text-2xl; } +.text-3xl { font-size: $text-3xl; } +.text-4xl { font-size: $text-4xl; } + +.font-thin { font-weight: $font-thin; } +.font-light { font-weight: $font-light; } +.font-normal { font-weight: $font-normal; } +.font-medium { font-weight: $font-medium; } +.font-semibold { font-weight: $font-semibold; } +.font-bold { font-weight: $font-bold; } +.font-extrabold { font-weight: $font-extrabold; } +.font-black { font-weight: $font-black; } + +.text-left { text-align: left; } +.text-center { text-align: center; } +.text-right { text-align: right; } +.text-justify { text-align: justify; } + +.text-primary { color: $primary-600; } +.text-secondary { color: $secondary-600; } +.text-success { color: $success; } +.text-warning { color: $warning; } +.text-error { color: $error; } +.text-gray-500 { color: $gray-500; } +.text-gray-600 { color: $gray-600; } +.text-gray-700 { color: $gray-700; } +.text-gray-900 { color: $gray-900; } + +// Border Radius +.rounded-none { border-radius: $radius-none; } +.rounded-sm { border-radius: $radius-sm; } +.rounded { border-radius: $radius-base; } +.rounded-md { border-radius: $radius-md; } +.rounded-lg { border-radius: $radius-lg; } +.rounded-xl { border-radius: $radius-xl; } +.rounded-2xl { border-radius: $radius-2xl; } +.rounded-3xl { border-radius: $radius-3xl; } +.rounded-full { border-radius: $radius-full; } + +// Shadows +.shadow-sm { box-shadow: $shadow-sm; } +.shadow { box-shadow: $shadow-base; } +.shadow-md { box-shadow: $shadow-md; } +.shadow-lg { box-shadow: $shadow-lg; } +.shadow-xl { box-shadow: $shadow-xl; } +.shadow-2xl { box-shadow: $shadow-2xl; } +.shadow-inner { box-shadow: $shadow-inner; } + +// Transitions +.transition { transition: all $duration-200 $ease-out; } +.transition-fast { transition: all $duration-150 $ease-out; } +.transition-slow { transition: all $duration-300 $ease-out; } + +// Responsive Utilities +// ======================================== + +@media (max-width: $breakpoint-sm) { + .sm\:hidden { display: none; } + .sm\:block { display: block; } + .sm\:flex { display: flex; } + .sm\:text-sm { font-size: $text-sm; } + .sm\:text-base { font-size: $text-base; } + .sm\:p-2 { padding: $space-2; } + .sm\:p-4 { padding: $space-4; } +} + +@media (max-width: $breakpoint-md) { + .md\:hidden { display: none; } + .md\:block { display: block; } + .md\:flex { display: flex; } + .md\:text-sm { font-size: $text-sm; } + .md\:text-base { font-size: $text-base; } + .md\:p-2 { padding: $space-2; } + .md\:p-4 { padding: $space-4; } +} + +@media (max-width: $breakpoint-lg) { + .lg\:hidden { display: none; } + .lg\:block { display: block; } + .lg\:flex { display: flex; } + .lg\:text-sm { font-size: $text-sm; } + .lg\:text-base { font-size: $text-base; } + .lg\:p-2 { padding: $space-2; } + .lg\:p-4 { padding: $space-4; } +} + +// Accessibility +// ======================================== + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} + +// Reduced Motion +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + scroll-behavior: auto !important; + } +} diff --git a/frontend/angular-clarity-master/src/styles/_components.scss b/frontend/angular-clarity-master/src/styles/_components.scss new file mode 100644 index 0000000..5799161 --- /dev/null +++ b/frontend/angular-clarity-master/src/styles/_components.scss @@ -0,0 +1,709 @@ +// ======================================== +// COMPONENT STYLES - Modern UI Components +// ======================================== + + +@import './design-tokens'; + +// Card Components +// ======================================== + +.modern-card { + background: $card-bg; + backdrop-filter: $backdrop-blur-md; + border: 1px solid $card-border; + border-radius: $radius-xl; + box-shadow: $card-shadow; + padding: $space-6; + transition: all $duration-300 $ease-out; + position: relative; + overflow: hidden; + + &::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 1px; + background: $glass-gradient; + } + + &:hover { + transform: translateY(-2px); + box-shadow: $shadow-xl; + border-color: rgba($primary-500, 0.2); + } + + &.glassmorphism { + background: rgba(255, 255, 255, 0.1); + backdrop-filter: $backdrop-blur-lg; + border: 1px solid rgba(255, 255, 255, 0.2); + } + + &.gradient { + background: $gradient-primary; + color: $white; + border: none; + + &::before { + background: rgba(255, 255, 255, 0.1); + } + } +} + +.card-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: $space-4; + padding-bottom: $space-4; + border-bottom: 1px solid $gray-200; + + .card-title { + font-size: $text-xl; + font-weight: $font-semibold; + color: $gray-900; + margin: 0; + } + + .card-actions { + display: flex; + gap: $space-2; + } +} + +.card-body { + color: $gray-700; + line-height: $leading-relaxed; +} + +.card-footer { + margin-top: $space-4; + padding-top: $space-4; + border-top: 1px solid $gray-200; + display: flex; + justify-content: flex-end; + gap: $space-3; +} + +// Button Components +// ======================================== + +.modern-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: $space-2; + padding: $space-3 $space-6; + font-size: $text-sm; + font-weight: $font-medium; + line-height: 1; + border-radius: $radius-lg; + border: 1px solid transparent; + cursor: pointer; + transition: all $duration-200 $ease-out; + text-decoration: none; + position: relative; + overflow: hidden; + + &:focus { + outline: 2px solid $primary-500; + outline-offset: 2px; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } + + // Sizes + &.btn-sm { + padding: $space-2 $space-4; + font-size: $text-xs; + height: $btn-height-sm; + } + + &.btn-md { + padding: $space-3 $space-6; + font-size: $text-sm; + height: $btn-height-md; + } + + &.btn-lg { + padding: $space-4 $space-8; + font-size: $text-base; + height: $btn-height-lg; + } + + // Variants + &.btn-primary { + background: $gradient-primary; + color: $white; + border-color: $primary-600; + + &:hover { + background: linear-gradient(135deg, $primary-600 0%, $primary-800 100%); + transform: translateY(-1px); + box-shadow: $shadow-lg; + } + + &:active { + transform: translateY(0); + box-shadow: $shadow-md; + } + } + + &.btn-secondary { + background: $white; + color: $gray-700; + border-color: $gray-300; + + &:hover { + background: $gray-50; + border-color: $gray-400; + transform: translateY(-1px); + box-shadow: $shadow-md; + } + } + + &.btn-outline { + background: transparent; + color: $primary-600; + border-color: $primary-600; + + &:hover { + background: $primary-50; + border-color: $primary-700; + color: $primary-700; + } + } + + &.btn-ghost { + background: transparent; + color: $gray-600; + border-color: transparent; + + &:hover { + background: $gray-100; + color: $gray-900; + } + } + + &.btn-success { + background: $gradient-success; + color: $white; + border-color: $accent-green; + + &:hover { + background: linear-gradient(135deg, #059669 0%, #047857 100%); + transform: translateY(-1px); + box-shadow: $shadow-lg; + } + } + + &.btn-warning { + background: $gradient-warning; + color: $white; + border-color: $accent-orange; + + &:hover { + background: linear-gradient(135deg, #d97706 0%, #b45309 100%); + transform: translateY(-1px); + box-shadow: $shadow-lg; + } + } + + &.btn-error { + background: $gradient-error; + color: $white; + border-color: $accent-red; + + &:hover { + background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); + transform: translateY(-1px); + box-shadow: $shadow-lg; + } + } + + // Loading state + &.loading { + position: relative; + color: transparent; + + &::after { + content: ''; + position: absolute; + width: 16px; + height: 16px; + border: 2px solid transparent; + border-top: 2px solid currentColor; + border-radius: 50%; + animation: spin 1s linear infinite; + } + } +} + +@keyframes spin { + to { + transform: rotate(360deg); + } +} + +// Form Components +// ======================================== + +.modern-form-group { + margin-bottom: $space-6; + + .form-label { + display: block; + font-size: $text-sm; + font-weight: $font-medium; + color: $gray-700; + margin-bottom: $space-2; + } + + .form-input { + width: 100%; + padding: $space-3 $space-4; + font-size: $text-sm; + line-height: $leading-normal; + color: $gray-900; + background: $white; + border: 1px solid $input-border; + border-radius: $radius-lg; + transition: all $duration-200 $ease-out; + + &:focus { + outline: none; + border-color: $input-border-focus; + box-shadow: 0 0 0 3px rgba($primary-500, 0.1); + } + + &:disabled { + background: $gray-100; + color: $gray-500; + cursor: not-allowed; + } + + &.error { + border-color: $input-border-error; + box-shadow: 0 0 0 3px rgba($error, 0.1); + } + + &::placeholder { + color: $gray-400; + } + } + + .form-textarea { + @extend .form-input; + min-height: 120px; + resize: vertical; + } + + .form-select { + @extend .form-input; + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e"); + background-position: right $space-3 center; + background-repeat: no-repeat; + background-size: 16px 12px; + padding-right: $space-10; + appearance: none; + } + + .form-error { + margin-top: $space-1; + font-size: $text-xs; + color: $error; + } + + .form-help { + margin-top: $space-1; + font-size: $text-xs; + color: $gray-500; + } +} + +// Input Group +.input-group { + display: flex; + align-items: stretch; + + .input-group-prepend { + display: flex; + align-items: center; + padding: $space-3 $space-4; + background: $gray-100; + border: 1px solid $gray-300; + border-right: none; + border-radius: $radius-lg 0 0 $radius-lg; + color: $gray-600; + } + + .input-group-append { + display: flex; + align-items: center; + padding: $space-3 $space-4; + background: $gray-100; + border: 1px solid $gray-300; + border-left: none; + border-radius: 0 $radius-lg $radius-lg 0; + color: $gray-600; + } + + .form-input { + border-radius: 0; + + &:first-child { + border-radius: $radius-lg 0 0 $radius-lg; + } + + &:last-child { + border-radius: 0 $radius-lg $radius-lg 0; + } + + &:only-child { + border-radius: $radius-lg; + } + } +} + +// Table Components +// ======================================== + +.modern-table { + width: 100%; + border-collapse: collapse; + background: $white; + border-radius: $radius-xl; + overflow: hidden; + box-shadow: $shadow-lg; + + thead { + background: $gray-50; + + th { + padding: $space-4 $space-6; + text-align: left; + font-size: $text-xs; + font-weight: $font-semibold; + color: $gray-600; + text-transform: uppercase; + letter-spacing: 0.05em; + border-bottom: 1px solid $gray-200; + + &:first-child { + padding-left: $space-8; + } + + &:last-child { + padding-right: $space-8; + } + } + } + + tbody { + tr { + transition: background-color $duration-150 $ease-out; + + &:hover { + background: $gray-50; + } + + &:not(:last-child) { + border-bottom: 1px solid $gray-200; + } + } + + td { + padding: $space-4 $space-6; + font-size: $text-sm; + color: $gray-700; + + &:first-child { + padding-left: $space-8; + } + + &:last-child { + padding-right: $space-8; + } + } + } +} + +// Badge Components +// ======================================== + +.modern-badge { + display: inline-flex; + align-items: center; + padding: $space-1 $space-3; + font-size: $text-xs; + font-weight: $font-medium; + border-radius: $radius-full; + text-transform: uppercase; + letter-spacing: 0.05em; + + &.badge-primary { + background: $primary-100; + color: $primary-800; + } + + &.badge-secondary { + background: $secondary-100; + color: $secondary-800; + } + + &.badge-success { + background: rgba($accent-green, 0.1); + color: $accent-green; + } + + &.badge-warning { + background: rgba($accent-orange, 0.1); + color: $accent-orange; + } + + &.badge-error { + background: rgba($accent-red, 0.1); + color: $accent-red; + } + + &.badge-gray { + background: $gray-100; + color: $gray-700; + } +} + +// Alert Components +// ======================================== + +.modern-alert { + padding: $space-4 $space-6; + border-radius: $radius-lg; + border: 1px solid; + margin-bottom: $space-4; + display: flex; + align-items: flex-start; + gap: $space-3; + + .alert-icon { + flex-shrink: 0; + margin-top: 2px; + } + + .alert-content { + flex: 1; + + .alert-title { + font-weight: $font-semibold; + margin-bottom: $space-1; + } + + .alert-message { + font-size: $text-sm; + line-height: $leading-relaxed; + } + } + + &.alert-info { + background: rgba($primary-500, 0.05); + border-color: rgba($primary-500, 0.2); + color: $primary-800; + + .alert-icon { + color: $primary-600; + } + } + + &.alert-success { + background: rgba($accent-green, 0.05); + border-color: rgba($accent-green, 0.2); + color: #065f46; + + .alert-icon { + color: $accent-green; + } + } + + &.alert-warning { + background: rgba($accent-orange, 0.05); + border-color: rgba($accent-orange, 0.2); + color: #92400e; + + .alert-icon { + color: $accent-orange; + } + } + + &.alert-error { + background: rgba($accent-red, 0.05); + border-color: rgba($accent-red, 0.2); + color: #991b1b; + + .alert-icon { + color: $accent-red; + } + } +} + +// Modal Components +// ======================================== + +.modern-modal { + .modal-backdrop { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba($black, 0.5); + backdrop-filter: $backdrop-blur-sm; + z-index: $z-modal-backdrop; + animation: fadeIn $duration-200 $ease-out; + } + + .modal-dialog { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background: $white; + border-radius: $radius-2xl; + box-shadow: $shadow-2xl; + z-index: $z-modal; + max-width: 90vw; + max-height: 90vh; + overflow: hidden; + animation: slideIn $duration-300 $ease-out; + + .modal-header { + padding: $space-6 $space-8; + border-bottom: 1px solid $gray-200; + display: flex; + align-items: center; + justify-content: space-between; + + .modal-title { + font-size: $text-xl; + font-weight: $font-semibold; + color: $gray-900; + margin: 0; + } + + .modal-close { + background: none; + border: none; + color: $gray-400; + cursor: pointer; + padding: $space-2; + border-radius: $radius-md; + transition: all $duration-200 $ease-out; + + &:hover { + background: $gray-100; + color: $gray-600; + } + } + } + + .modal-body { + padding: $space-6 $space-8; + max-height: 60vh; + overflow-y: auto; + } + + .modal-footer { + padding: $space-6 $space-8; + border-top: 1px solid $gray-200; + display: flex; + justify-content: flex-end; + gap: $space-3; + } + } +} + +@keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes slideIn { + from { + opacity: 0; + transform: translate(-50%, -60%); + } + to { + opacity: 1; + transform: translate(-50%, -50%); + } +} + +// Loading Components +// ======================================== + +.modern-spinner { + display: inline-block; + width: 20px; + height: 20px; + border: 2px solid $gray-200; + border-top: 2px solid $primary-500; + border-radius: 50%; + animation: spin 1s linear infinite; + + &.spinner-sm { + width: 16px; + height: 16px; + border-width: 1.5px; + } + + &.spinner-lg { + width: 32px; + height: 32px; + border-width: 3px; + } +} + +.modern-skeleton { + background: linear-gradient(90deg, $gray-200 25%, $gray-100 50%, $gray-200 75%); + background-size: 200% 100%; + animation: shimmer 1.5s infinite; + border-radius: $radius-md; + + &.skeleton-text { + height: 1em; + margin-bottom: $space-2; + } + + &.skeleton-title { + height: 1.5em; + margin-bottom: $space-4; + } + + &.skeleton-avatar { + width: 40px; + height: 40px; + border-radius: 50%; + } + + &.skeleton-button { + height: 40px; + width: 100px; + } +} + +@keyframes shimmer { + 0% { + background-position: -200% 0; + } + 100% { + background-position: 200% 0; + } +} diff --git a/frontend/angular-clarity-master/src/styles/_design-tokens.scss b/frontend/angular-clarity-master/src/styles/_design-tokens.scss new file mode 100644 index 0000000..e91dfd5 --- /dev/null +++ b/frontend/angular-clarity-master/src/styles/_design-tokens.scss @@ -0,0 +1,258 @@ +// ======================================== +// DESIGN TOKENS - Modern UI Design System +// ======================================== + +// Dynamic Theme Variables (CSS Custom Properties) +// ======================================== +:root { + // Default theme colors (fallback) + --theme-primary: #0ea5e9; + --theme-secondary: #64748b; + --theme-accent: #8b5cf6; + --theme-error: #ef4444; + --theme-error-dark: #dc2626; + --theme-background: #f8fafc; + --theme-surface: #ffffff; + --theme-text: #1f2937; + --theme-text-secondary: #6b7280; + --theme-border-radius: 0.5rem; + --theme-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); + --theme-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + --theme-font-secondary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + --theme-font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace; +} + +// Color Palette +// ======================================== + +// Primary Colors (with theme support) +$primary-50: #f0f9ff; +$primary-100: #e0f2fe; +$primary-200: #bae6fd; +$primary-300: #7dd3fc; +$primary-400: #38bdf8; +$primary-500: var(--theme-primary, #0ea5e9); // Dynamic primary +$primary-600: #0284c7; +$primary-700: #0369a1; +$primary-800: #075985; +$primary-900: #0c4a6e; + +// Secondary Colors (with theme support) +$secondary-50: #f8fafc; +$secondary-100: #f1f5f9; +$secondary-200: #e2e8f0; +$secondary-300: #cbd5e1; +$secondary-400: #94a3b8; +$secondary-500: var(--theme-secondary, #64748b); // Dynamic secondary +$secondary-600: #475569; +$secondary-700: #334155; +$secondary-800: #1e293b; +$secondary-900: #0f172a; + +// Accent Colors (with theme support) +$accent-purple: var(--theme-accent, #8b5cf6); +$accent-green: #10b981; +$accent-orange: #f59e0b; +$accent-red: #ef4444; +$accent-pink: #ec4899; + +// Neutral Colors (with theme support) +$white: #ffffff; +$gray-50: #f9fafb; +$gray-100: #f3f4f6; +$gray-200: #e5e7eb; +$gray-300: #d1d5db; +$gray-400: #9ca3af; +$gray-500: #6b7280; +$gray-600: #4b5563; +$gray-700: #374151; +$gray-800: #1f2937; +$gray-900: var(--theme-text, #111827); // Dynamic text color +$black: #000000; + +// Theme-aware colors +$theme-background: var(--theme-background, #f8fafc); +$theme-surface: var(--theme-surface, #ffffff); +$theme-text: var(--theme-text, #1f2937); +$theme-text-secondary: var(--theme-text-secondary, #6b7280); + +// Semantic Colors +$success: $accent-green; +$warning: $accent-orange; +$error: $accent-red; +$info: $primary-500; + +// Typography +// ======================================== + +// Font Families (with theme support) +$font-primary: var(--theme-font-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif); +$font-secondary: var(--theme-font-secondary, 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif); +$font-mono: var(--theme-font-mono, 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace); + +// Font Sizes +$text-xs: 0.75rem; // 12px +$text-sm: 0.875rem; // 14px +$text-base: 1rem; // 16px +$text-lg: 1.125rem; // 18px +$text-xl: 1.25rem; // 20px +$text-2xl: 1.5rem; // 24px +$text-3xl: 1.875rem; // 30px +$text-4xl: 2.25rem; // 36px +$text-5xl: 3rem; // 48px +$text-6xl: 3.75rem; // 60px + +// Font Weights +$font-thin: 100; +$font-light: 300; +$font-normal: 400; +$font-medium: 500; +$font-semibold: 600; +$font-bold: 700; +$font-extrabold: 800; +$font-black: 900; + +// Line Heights +$leading-none: 1; +$leading-tight: 1.25; +$leading-snug: 1.375; +$leading-normal: 1.5; +$leading-relaxed: 1.625; +$leading-loose: 2; + +// Spacing System +// ======================================== + +$space-0: 0; +$space-1: 0.25rem; // 4px +$space-2: 0.5rem; // 8px +$space-3: 0.75rem; // 12px +$space-4: 1rem; // 16px +$space-5: 1.25rem; // 20px +$space-6: 1.5rem; // 24px +$space-8: 2rem; // 32px +$space-10: 2.5rem; // 40px +$space-12: 3rem; // 48px +$space-16: 4rem; // 64px +$space-20: 5rem; // 80px +$space-24: 6rem; // 96px +$space-32: 8rem; // 128px + +// Border Radius (with theme support) +// ======================================== + +$radius-none: 0; +$radius-sm: 0.125rem; // 2px +$radius-base: 0.25rem; // 4px +$radius-md: 0.375rem; // 6px +$radius-lg: var(--theme-border-radius, 0.5rem); // Dynamic border radius +$radius-xl: 0.75rem; // 12px +$radius-2xl: 1rem; // 16px +$radius-3xl: 1.5rem; // 24px +$radius-full: 9999px; + +// Shadows (with theme support) +// ======================================== + +$shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); +$shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); +$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); +$shadow-lg: var(--theme-shadow, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)); // Dynamic shadow +$shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); +$shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25); +$shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); + +// Glassmorphism Shadows +$glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); +$glass-shadow-lg: 0 20px 40px 0 rgba(31, 38, 135, 0.4); + +// Animation +// ======================================== + +// Timing Functions +$ease-in: cubic-bezier(0.4, 0, 1, 1); +$ease-out: cubic-bezier(0, 0, 0.2, 1); +$ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); +$ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55); +$ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275); + +// Duration +$duration-75: 75ms; +$duration-100: 100ms; +$duration-150: 150ms; +$duration-200: 200ms; +$duration-300: 300ms; +$duration-500: 500ms; +$duration-700: 700ms; +$duration-1000: 1000ms; + +// Responsive Breakpoints +// ======================================== + +$breakpoint-sm: 640px; // Small devices +$breakpoint-md: 768px; // Medium devices +$breakpoint-lg: 1024px; // Large devices +$breakpoint-xl: 1280px; // Extra large devices +$breakpoint-2xl: 1536px; // 2X large devices + +// Z-Index Scale +// ======================================== + +$z-dropdown: 1000; +$z-sticky: 1020; +$z-fixed: 1030; +$z-modal-backdrop: 1040; +$z-modal: 1050; +$z-popover: 1060; +$z-tooltip: 1070; +$z-toast: 1080; + +// Component Specific Variables +// ======================================== + +// Header +$header-height: 4rem; // 64px +$header-bg: rgba(255, 255, 255, 0.95); +$header-border: rgba(0, 0, 0, 0.1); + +// Sidebar +$sidebar-width: 16rem; // 256px +$sidebar-width-collapsed: 4rem; // 64px +$sidebar-bg: rgba(255, 255, 255, 0.98); +$sidebar-border: rgba(0, 0, 0, 0.05); + +// Cards +$card-bg: rgba(255, 255, 255, 0.9); +$card-border: rgba(0, 0, 0, 0.05); +$card-shadow: $shadow-lg; + +// Buttons +$btn-height-sm: 2rem; // 32px +$btn-height-md: 2.5rem; // 40px +$btn-height-lg: 3rem; // 48px + +// Form Elements +$input-height: 2.5rem; // 40px +$input-border: rgba(0, 0, 0, 0.1); +$input-border-focus: $primary-500; +$input-border-error: $error; + +// Gradients +// ======================================== + +$gradient-primary: linear-gradient(135deg, $primary-500 0%, $primary-700 100%); +$gradient-secondary: linear-gradient(135deg, $secondary-500 0%, $secondary-700 100%); +$gradient-accent: linear-gradient(135deg, $accent-purple 0%, $accent-pink 100%); +$gradient-success: linear-gradient(135deg, $accent-green 0%, #059669 100%); +$gradient-warning: linear-gradient(135deg, $accent-orange 0%, #d97706 100%); +$gradient-error: linear-gradient(135deg, $accent-red 0%, #dc2626 100%); + +// Glassmorphism Gradients +$glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%); +$glass-gradient-dark: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%); + +// Backdrop Blur +$backdrop-blur-sm: blur(4px); +$backdrop-blur-md: blur(8px); +$backdrop-blur-lg: blur(16px); +$backdrop-blur-xl: blur(24px); diff --git a/frontend/angular-clarity-master/src/styles/_theme-variables.scss b/frontend/angular-clarity-master/src/styles/_theme-variables.scss new file mode 100644 index 0000000..dbb184a --- /dev/null +++ b/frontend/angular-clarity-master/src/styles/_theme-variables.scss @@ -0,0 +1,367 @@ +// ======================================== +// DYNAMIC THEME VARIABLES +// ======================================== +@import './design-tokens'; +// CSS Custom Properties for Dynamic Theming +// These variables will be set by the ThemeService at runtime + +:root { + // Default theme variables (fallback values) + --theme-primary: #0ea5e9; + --theme-secondary: #64748b; + --theme-accent: #8b5cf6; + --theme-background: #f8fafc; + --theme-surface: #ffffff; + --theme-text: #111827; + --theme-text-secondary: #6b7280; + + // Font variables + --theme-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + --theme-font-secondary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + --theme-font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace; + + // Other theme properties + --theme-border-radius: 0.75rem; + --theme-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); + + // Derived colors for better theme integration + --theme-primary-50: #{rgba(#0ea5e9, 0.05)}; + --theme-primary-100: #{rgba(#0ea5e9, 0.1)}; + --theme-primary-200: #{rgba(#0ea5e9, 0.2)}; + --theme-primary-300: #{rgba(#0ea5e9, 0.3)}; + --theme-primary-500: #0ea5e9; + --theme-primary-600: #{darken(#0ea5e9, 10%)}; + --theme-primary-700: #{darken(#0ea5e9, 20%)}; + --theme-primary-800: #{darken(#0ea5e9, 30%)}; + --theme-primary-900: #{darken(#0ea5e9, 40%)}; + + // Gradient definitions using theme colors + --theme-gradient-primary: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-700) 100%); + --theme-gradient-secondary: linear-gradient(135deg, var(--theme-secondary) 0%, #{darken(#64748b, 20%)} 100%); + --theme-gradient-accent: linear-gradient(135deg, var(--theme-accent) 0%, #{darken(#8b5cf6, 20%)} 100%); + + // Glassmorphism effects + --theme-glass-bg: rgba(255, 255, 255, 0.1); + --theme-glass-border: rgba(255, 255, 255, 0.2); + --theme-glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); +} + +// Dark theme overrides +[data-theme="dark"] { + --theme-background: #111827; + --theme-surface: #1f2937; + --theme-text: #f9fafb; + --theme-text-secondary: #d1d5db; + --theme-glass-bg: rgba(0, 0, 0, 0.1); + --theme-glass-border: rgba(255, 255, 255, 0.1); + --theme-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5); +} + +// Theme-aware utility classes +// ======================================== + +// Background colors +.bg-theme-primary { background-color: var(--theme-primary) !important; } +.bg-theme-secondary { background-color: var(--theme-secondary) !important; } +.bg-theme-accent { background-color: var(--theme-accent) !important; } +.bg-theme-background { background-color: var(--theme-background) !important; } +.bg-theme-surface { background-color: var(--theme-surface) !important; } + +// Text colors +.text-theme-primary { color: var(--theme-primary) !important; } +.text-theme-secondary { color: var(--theme-secondary) !important; } +.text-theme-accent { color: var(--theme-accent) !important; } +.text-theme-text { color: var(--theme-text) !important; } +.text-theme-text-secondary { color: var(--theme-text-secondary) !important; } + +// Border colors +.border-theme-primary { border-color: var(--theme-primary) !important; } +.border-theme-secondary { border-color: var(--theme-secondary) !important; } +.border-theme-accent { border-color: var(--theme-accent) !important; } + +// Gradients +.bg-gradient-theme-primary { background: var(--theme-gradient-primary) !important; } +.bg-gradient-theme-secondary { background: var(--theme-gradient-secondary) !important; } +.bg-gradient-theme-accent { background: var(--theme-gradient-accent) !important; } + +// Font families +.font-theme-primary { font-family: var(--theme-font-primary) !important; } +.font-theme-secondary { font-family: var(--theme-font-secondary) !important; } +.font-theme-mono { font-family: var(--theme-font-mono) !important; } + +// Border radius +.rounded-theme { border-radius: var(--theme-border-radius) !important; } + +// Shadows +.shadow-theme { box-shadow: var(--theme-shadow) !important; } + +// Glassmorphism effects +.glass-theme { + background: var(--theme-glass-bg) !important; + backdrop-filter: blur(16px) !important; + border: 1px solid var(--theme-glass-border) !important; + box-shadow: var(--theme-glass-shadow) !important; +} + +// Theme-aware component overrides +// ======================================== + +// Update existing component styles to use theme variables +.modern-card { + background: var(--theme-surface); + color: var(--theme-text); + border: 1px solid rgba(var(--theme-text-secondary), 0.1); + box-shadow: var(--theme-shadow); +} + +.modern-btn { + &.btn-primary { + background: var(--theme-gradient-primary); + color: white; + border-color: var(--theme-primary-600); + } + + &.btn-secondary { + background: var(--theme-surface); + color: var(--theme-text); + border-color: rgba(var(--theme-text-secondary), 0.2); + } + + &.btn-outline { + background: transparent; + color: var(--theme-primary); + border-color: var(--theme-primary); + } +} + +.modern-form-group { + .form-label { + color: var(--theme-text); + } + + .form-input { + background: var(--theme-surface); + color: var(--theme-text); + border-color: rgba(var(--theme-text-secondary), 0.2); + + &:focus { + border-color: var(--theme-primary); + box-shadow: 0 0 0 3px var(--theme-primary-100); + } + + &::placeholder { + color: var(--theme-text-secondary); + } + } +} + +.modern-table { + background: var(--theme-surface); + color: var(--theme-text); + + thead { + background: var(--theme-background); + + th { + color: var(--theme-text-secondary); + } + } + + tbody { + tr { + &:hover { + background: var(--theme-background); + } + } + + td { + color: var(--theme-text); + } + } +} + +.modern-alert { + &.alert-info { + background: var(--theme-primary-100); + border-color: var(--theme-primary-200); + color: var(--theme-primary-800); + } + + &.alert-success { + background: rgba(16, 185, 129, 0.1); + border-color: rgba(16, 185, 129, 0.2); + color: #065f46; + } + + &.alert-warning { + background: rgba(245, 158, 11, 0.1); + border-color: rgba(245, 158, 11, 0.2); + color: #92400e; + } + + &.alert-error { + background: rgba(239, 68, 68, 0.1); + border-color: rgba(239, 68, 68, 0.2); + color: #991b1b; + } +} + +// Layout component theme integration +// ======================================== + +.modern-layout { + background: var(--theme-background); +} + +.modern-header { + background: rgba(var(--theme-surface), 0.95); + border-bottom: 1px solid rgba(var(--theme-text-secondary), 0.1); + color: var(--theme-text); +} + +.modern-branding { + .company-title { + color: var(--theme-text); + } + + .company-subtitle { + color: var(--theme-text-secondary); + } +} + +.modern-sidebar { + background: rgba(var(--theme-surface), 0.98); + border-right: 1px solid rgba(var(--theme-text-secondary), 0.05); + color: var(--theme-text); +} + +.modern-nav-link, +.modern-nav-link-single { + color: var(--theme-text-secondary); + + &:hover { + background: var(--theme-primary-100); + color: var(--theme-primary-700); + } + + &.active { + background: var(--theme-primary-100); + color: var(--theme-primary-800); + } +} + +.modern-user-button { + background: transparent; + color: var(--theme-text); + border-color: rgba(var(--theme-text-secondary), 0.2); + + &:hover { + background: var(--theme-background); + border-color: rgba(var(--theme-text-secondary), 0.3); + } +} + +.modern-dropdown-menu { + background: var(--theme-surface); + border-color: rgba(var(--theme-text-secondary), 0.2); + color: var(--theme-text); +} + +.modern-dropdown-item { + color: var(--theme-text); + + &:hover { + background: var(--theme-background); + color: var(--theme-text); + } +} + +// Dashboard theme integration +// ======================================== + +.modern-dashboard { + background: var(--theme-background); +} + +.welcome-section { + background: var(--theme-gradient-primary); + color: white; +} + +.stats-card { + background: var(--theme-surface); + color: var(--theme-text); + border: 1px solid rgba(var(--theme-text-secondary), 0.1); + + .stats-value { + color: var(--theme-text); + } + + .stats-label { + color: var(--theme-text-secondary); + } +} + +.action-card { + background: var(--theme-surface); + color: var(--theme-text); + border-color: rgba(var(--theme-text-secondary), 0.2); + + &:hover { + border-color: var(--theme-primary-300); + } + + h3 { + color: var(--theme-text); + } + + p { + color: var(--theme-text-secondary); + } +} + +.activity-card { + background: var(--theme-surface); + color: var(--theme-text); + + .activity-item { + border-bottom-color: rgba(var(--theme-text-secondary), 0.1); + + &:hover { + background: var(--theme-background); + } + + .activity-title { + color: var(--theme-text); + } + + .activity-time { + color: var(--theme-text-secondary); + } + } +} + +// Responsive theme adjustments +// ======================================== + +@media (prefers-color-scheme: dark) { + :root:not([data-theme]) { + --theme-background: #111827; + --theme-surface: #1f2937; + --theme-text: #f9fafb; + --theme-text-secondary: #d1d5db; + } +} + +// Print styles +// ======================================== + +@media print { + :root { + --theme-background: white; + --theme-surface: white; + --theme-text: black; + --theme-text-secondary: #666; + --theme-shadow: none; + } +} diff --git a/frontend/angular-clarity-master/src/styles1.scss b/frontend/angular-clarity-master/src/styles1.scss new file mode 100644 index 0000000..2d5f160 --- /dev/null +++ b/frontend/angular-clarity-master/src/styles1.scss @@ -0,0 +1,54 @@ +input[type=text],[type=date],[type=password] { + width: 100%; + padding: 15px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} diff --git a/frontend/angular-clarity-master/src/test.ts b/frontend/angular-clarity-master/src/test.ts new file mode 100644 index 0000000..ae25f27 --- /dev/null +++ b/frontend/angular-clarity-master/src/test.ts @@ -0,0 +1,16 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false } +} +); diff --git a/frontend/angular-clarity-master/tsconfig.app.json b/frontend/angular-clarity-master/tsconfig.app.json new file mode 100644 index 0000000..82d91dc --- /dev/null +++ b/frontend/angular-clarity-master/tsconfig.app.json @@ -0,0 +1,15 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": [ + "src/main.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.d.ts" + ] +} diff --git a/frontend/angular-clarity-master/tsconfig.json b/frontend/angular-clarity-master/tsconfig.json new file mode 100644 index 0000000..b62b646 --- /dev/null +++ b/frontend/angular-clarity-master/tsconfig.json @@ -0,0 +1,21 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "importHelpers": true, + "target": "ES2022", + "module": "ES2022", + "lib": [ + "ES2022", + "dom" + ], + "useDefineForClassFields": false + } +} diff --git a/frontend/angular-clarity-master/tsconfig.spec.json b/frontend/angular-clarity-master/tsconfig.spec.json new file mode 100644 index 0000000..092345b --- /dev/null +++ b/frontend/angular-clarity-master/tsconfig.spec.json @@ -0,0 +1,18 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": [ + "jasmine" + ] + }, + "files": [ + "src/test.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/frontend/angular-clarity-master/tslint.json b/frontend/angular-clarity-master/tslint.json new file mode 100644 index 0000000..67bcdea --- /dev/null +++ b/frontend/angular-clarity-master/tslint.json @@ -0,0 +1,152 @@ +{ + "extends": "tslint:recommended", + "rules": { + "align": { + "options": [ + "parameters", + "statements" + ] + }, + "array-type": false, + "arrow-return-shorthand": true, + "curly": true, + "deprecation": { + "severity": "warning" + }, + "component-class-suffix": true, + "contextual-lifecycle": true, + "directive-class-suffix": true, + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ], + "eofline": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "import-spacing": true, + "indent": { + "options": [ + "spaces" + ] + }, + "max-classes-per-file": false, + "max-line-length": [ + true, + 140 + ], + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-empty": false, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-non-null-assertion": true, + "no-redundant-jsdoc": true, + "no-switch-case-fall-through": true, + "no-var-requires": false, + "object-literal-key-quotes": [ + true, + "as-needed" + ], + "quotemark": [ + true, + "single" + ], + "semicolon": { + "options": [ + "always" + ] + }, + "space-before-function-paren": { + "options": { + "anonymous": "never", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + }, + "typedef": [ + true, + "call-signature" + ], + "typedef-whitespace": { + "options": [ + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ] + }, + "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-pascal-case" + ] + }, + "whitespace": { + "options": [ + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type", + "check-typecast" + ] + }, + "no-conflicting-lifecycle": true, + "no-host-metadata-property": true, + "no-input-rename": true, + "no-inputs-metadata-property": true, + "no-output-native": true, + "no-output-on-prefix": true, + "no-output-rename": true, + "no-outputs-metadata-property": true, + "template-banana-in-box": true, + "template-no-negated-async": true, + "use-lifecycle-interface": true, + "use-pipe-transform-interface": true + }, + "rulesDirectory": [ + "codelyzer" + ] +} \ No newline at end of file