A small plugin for Frappe that adds the support of customizations to the attach control.

Overview

Frappe Better Attach Control

A small plugin for Frappe that adds the support of customizations to the attach control.

Table of Contents


Requirements

  • Frappe >= v13.0.0

Setup

Install

  1. Get the plugin from Github

(Required only once)

bench get-app https://github.com/kid1194/frappe-better-attach-control

  1. Install the plugin on any instance/site you want

bench --site [sitename] install-app frappe_better_attach_control

  1. Check the usage section below

Update

  1. Go to the app directory (frappe-bench/apps/frappe_better_attach_control) and execute:

git pull

  1. Go back to the frappe-bench directory and execute:

bench --site [sitename] migrate

  1. In case you need to restart bench, execute:

bench restart

Uninstall

  1. Uninstall the plugin from the instance/site

bench --site [sitename] uninstall-app frappe_better_attach_control

  1. Uninstall the plugin from bench

bench remove-app frappe_better_attach_control


Usage

  1. Go to Customization > Customize Form
  2. Enter the form type/name (Ex: 'User')
  3. Scroll down to the form fields area and edit the Attach or Attach Image fields you want
  4. In the options property of the fields, add a JSON object of the customizations you want. Example: {"allowed_file_types": ["jpg", "png", "gif"]}

Available Options

upload_notes

Upload text to be displayed.

Example: "Only allowed to upload images and video, with maximum size of 2MB"

Default: ""

allow_multiple

Allow multiple uploads.

⚠️ (Field value is a JSON array of files url)

Default: false

max_file_size

Maximum file size (in bytes) that is allowed to be uploaded.

Example: 2048 for 2KB

Default: Value of maximum file size in Frappe's settings

allowed_file_types

Array of allowed file types (mimes) or extensions to upload.

Example: ["image/*", "video/*", ".pdf", ".doc"]

Default: null or ["image/*"]

max_number_of_files

Maximum number of files allowed to be uploaded if multiple upload is allowed.

⚠️ (Bypassing the maximum attachments of doctype might not work)

Example: 4

Default: Value of maximum attachments set for the doctype

crop_image_aspect_ratio

Crop aspect ratio for images (Frappe >= v14.0.0).

Example: 1 or 16/9 or 4/3

Default: 1


Supported Fields

  • Attach
  • Attach Image

ToDo

  • HTML display for multiple files upload in Attach control
  • Display popover for multiple files upload in Attach Image control

License

MIT

You might also like...
Zwave to Mqtt gateway and Control Panel Web UI. Built using Nodejs, and Vue/Vuetify
Zwave to Mqtt gateway and Control Panel Web UI. Built using Nodejs, and Vue/Vuetify

Zwavejs2Mqtt TO Fully configurable Zwave to MQTT Gateway and Control Panel. Backend: NodeJS, Express, socket.io, Mqttjs, zwavejs, Webpack Frontend: Vu

5GRecords camera control NMOS IS-07 based frontend

Camera Control GUI A test camera control web interface for Sony-nmos IS-07 based camera control. In the context of 5G-Records EU project. Credits Web

Browser-based control panel system for OCS, written in Vue 3.

ocs-web Background This is browser-based control panel system for OCS, written in Vue 3. Project setup Run this to fetch all dependencies into the pro

Create and manage invoices in your browser. Serverless Invoices is a free invoicing tool for freelancers and small businesses. Made with Vue.js.

Serverless Invoices by Moku Serverless Invoices is a free invoicing tool for freelancers and small businesses. It is open-source and easily extendable

OSL is a simple shared list web-application based on Node. Typical uses include shopping lists of course, and any other small todo-list that needs to be used collaboratively.
OSL is a simple shared list web-application based on Node. Typical uses include shopping lists of course, and any other small todo-list that needs to be used collaboratively.

Our Shopping List OSL is a simple shared list application. Typical uses include shopping lists of course, and any other small todo-list that needs to

Desktop app for miners on the Helium network. Small taskbar tool to follow status, activity and earnings for the chosen devices.

Helium-Flick is a desktop application for Helium hotspot owners, in the shape of a small taskbar tool, which allows you to follow the status, activity and earnings for the devices of your list. The purpose of this application is to keep track of all your hotspots, directly at the corner of your screen.

Dozzle is a small lightweight application with a web based interface to monitor Docker logs
CMS web page for the creation of small e-commerce developed with Laravel and Vue+Vuex

Delivery Service Descrizione il servizio deve permettere con facilita' la possibilita' per un utente di trovare i ristoranti/negozi/bar che fanno atti

My very first VueJS project. A small news portal consuming The New York Times API.

VUE NEWS News Portal Using New York Times API PREVIEW: https://bit.ly/3opdAiU Technologies Used VueJS Typescript CSS Cypress (via @vue/cli-plugin-e2e-

Comments
  • Error while getting branch v2-beta

    Error while getting branch v2-beta

    find the log below... the error seems to be a build error

    Getting frappe-better-attach-control
    $ git clone https://github.com/kid1194/frappe-better-attach-control --branch v2-beta --depth 1 --origin upstream
    Cloning into 'frappe-better-attach-control'...
    remote: Enumerating objects: 59, done.
    remote: Counting objects: 100% (59/59), done.
    remote: Compressing objects: 100% (41/41), done.
    remote: Total 59 (delta 15), reused 40 (delta 10), pack-reused 0
    Receiving objects: 100% (59/59), 31.04 KiB | 836.00 KiB/s, done.
    Resolving deltas: 100% (15/15), done.
    Ignoring dependencies of https://github.com/kid1194/frappe-better-attach-control. To install dependencies use --resolve-deps
    Installing frappe_better_attach_control
    $ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe_better_attach_control 
    $ bench build --app frappe_better_attach_control
    ✔ Application Assets Linked                                                                                                                                   
    
    
    yarn run v1.22.19
    warning ../../package.json: No license field
    $ node esbuild --production --apps frappe_better_attach_control --run-build-command
    ✘ [ERROR] No matching export in "../frappe_better_attach_control/frappe_better_attach_control/public/js/filetypes/audio.js" for import "default"
    
        ../frappe_better_attach_control/frappe_better_attach_control/public/js/filetypes/index.js:8:7:
          8 │ import is_audio from './audio.js';
            ╵        ~~~~~~~~
    
    ✘ [ERROR] No matching export in "../frappe_better_attach_control/frappe_better_attach_control/public/js/filetypes/pdocument.js" for import "default"
    
        ../frappe_better_attach_control/frappe_better_attach_control/public/js/filetypes/index.js:11:7:
          11 │ import is_pdocument from './pdocument.js';
             ╵        ~~~~~~~~~~~~
    
     ERROR  There were some problems during build
    
    Error: Build failed with 2 errors:
    ../frappe_better_attach_control/frappe_better_attach_control/public/js/filetypes/index.js:8:7: ERROR: No matching export in "../frappe_better_attach_control/frappe_better_attach_control/public/js/filetypes/audio.js" for import "default"
    ../frappe_better_attach_control/frappe_better_attach_control/public/js/filetypes/index.js:11:7: ERROR: No matching export in "../frappe_better_attach_control/frappe_better_attach_control/public/js/filetypes/pdocument.js" for import "default"
        at failureErrorWithLog (/home/frappe/frappe-bench/apps/frappe/node_modules/esbuild/lib/main.js:1600:15)
        at /home/frappe/frappe-bench/apps/frappe/node_modules/esbuild/lib/main.js:1246:28
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
    Terminated
    error Command failed with exit code 143.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    Traceback (most recent call last):
      File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
        main()
      File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
        click.Group(commands=commands)(prog_name="bench")
      File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
        rv = self.invoke(ctx)
      File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py", line 82, in build
        bundle(mode, apps=apps, hard_link=hard_link, verbose=verbose, skip_frappe=skip_frappe)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/build.py", line 257, in bundle
        frappe.commands.popen(command, cwd=frappe_app_path, env=get_node_env(), raise_err=True)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 98, in popen
        raise subprocess.CalledProcessError(return_, command)
    subprocess.CalledProcessError: Command 'yarn run production --apps frappe_better_attach_control --run-build-command' returned non-zero exit status 143.
    ERROR: 
    Traceback (most recent call last):
      File "/home/frappe/.local/bin/bench", line 8, in <module>
        sys.exit(cli())
      File "/home/frappe/.local/lib/python3.10/site-packages/bench/cli.py", line 127, in cli
        bench_command()
      File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
        return self.main(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
        rv = self.invoke(ctx)
      File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
        return __callback(*args, **kwargs)
      File "/home/frappe/.local/lib/python3.10/site-packages/bench/commands/make.py", line 159, in get_app
        get_app(
      File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 432, in get_app
        app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
      File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
        return fn(*args, **kwargs)
      File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 230, in install
        install_app(
      File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 574, in install_app
        build_assets(bench_path=bench_path, app=app)
      File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/bench.py", line 330, in build_assets
        exec_cmd(command, cwd=bench_path, env={"BENCH_DEVELOPER": "1"})
      File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/__init__.py", line 155, in exec_cmd
        raise CommandFailedError
    bench.exceptions.CommandFailedError
    
    bug 
    opened by chechani 1
  • Image Not Attaching

    Image Not Attaching

    Okay so we installed the master branch and we can't get attach any document/ image to the upload button. The standard behavior is for the attached file to link to the upload button.

    bug 
    opened by woakes070048 1
Releases(v2.0.0-beta-4)
Owner
Ameen Ahmed
Ameen Ahmed
A simple unopinionated Vue plugin for managing user roles and permissions, access-control list (ACL) and role-based access control (RBAC).

Vue Simple ACL A simple unopinionated Vue plugin for managing user roles and permissions, access-control list (ACL) and role-based access control (RBA

Victory Osayi 86 Dec 24, 2022
Pi-Control 🐱‍👤 is an App for controlling your raspberry pi. It was designed to help with information gathering, as well as to simplify control.

pi-control Preperations (one time) # maybe you need to add 'sudo' for every command, even to start 'pm2' service so it can edit files for example # i

null 8 Nov 22, 2022
Memory-control-demo - some web dev-tips about memory control.

前端的内存控制 为什么要关注内存,关注性能 前端开发,除了创建前端界面呈现给用户,也需要关注用户的使用体验。 在一些老旧的设备上,如果出现内存泄漏,很容易导致用户的设备白屏崩溃等问题。 同时,因为浏览器已经帮我们做了很多,很容易就忽略掉内存问题。 浏览器的内存回收 方式:标记清除 https://

Michael 0 Jan 4, 2022
FOSS Digital Asset Distribution Platform built on Frappe.

Digistore FOSS Digital Assets Marketplace. Distribute digital assets, like a pro. Video Demo Here Features Create, attach and list digital assets (PDF

Mohammad Hussain Nagaria 30 Dec 8, 2022
Frappe-ui - A set of components and utilities for rapid UI development

Frappe UI A set of components and utilities for rapid UI development. Frappe UI

Frappe 88 Dec 30, 2022
Small CMS for guide app with markdown support.

Guide app Small CMS for guide app with markdown support. Setup # install dependencies $ npm install # serve with hot reload at localhost:3000 $ npm r

null 0 Dec 23, 2022
Nova Kontainer - A Laravel Nove component that adds a file picker for Kontainer

Nova Kontainer Nova Kontainer is a Laravel Nove component that adds a file picker for Kontainer Features Select any image or video from Kontainer and

Jess Stopa 1 Feb 8, 2022
Open source browser extension that adds extra features to Metrc.

Welcome to Track & Trace Tools What's Track & Trace Tools? Track & Trace Tools is an open source browser extension that adds extra features to Metrc.

 Matt Frisbie 5 Dec 26, 2022
Remote control Windows machine from anywhere powered by UltraVNC Server and Piping Server

piping-vnc-server-for-windows Remote control Windows machine from anywhere powered by UltraVNC Server and Piping Server How to use Suppose that Window

Ryo Ota 8 Dec 26, 2022
Bytebase is a web-based, zero-config, dependency-free database schema change and version control management tool for developers and DBAs

Web-based, zero-config, dependency-free database schema change and version control tool for teams.

Bytebase 4.6k Jan 9, 2023